ErrorInterpolator

org.finos.morphir.runtime.ErrorUtils.ErrorInterpolator
implicit class ErrorInterpolator(sc: StringContext)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def barBlock(s: String): String
def barBlockNoDup(s: String): String
def barIndentBlock(header: String, body: String, barWidth: Int): String
def barIndentBlockTerminated(header: String, body: String): String
def err(args: Any*): String

This interpolator is intended to format errors with potentially bulky arguments which we wish to display as both IR and native elm. As such it takes the IR arguments and replaces them with a numeric ID in the string, and then prints them after the message in formatted blocks. For instance:

This interpolator is intended to format errors with potentially bulky arguments which we wish to display as both IR and native elm. As such it takes the IR arguments and replaces them with a numeric ID in the string, and then prints them after the message in formatted blocks. For instance:

Value type does not match declared type: (0) vs (1) ========== 0: ========== | ====Elm==== | | (1, 2) | ====IR==== | | T.Tuple(T.Ref(int), T.Ref(int)) ========== 1: ========== | ====Elm==== | | () | ====IR==== | | T.Unit(())

Value parameters

args

Either IR or non-IR elements to be displayed; IR elements will be handled specially.

Attributes

Returns

A human-readable error with the IR elements formatted for display after the error message.

def headerize(header: String, body: String): String
def indentBlock(s: String): String
def indentBlockPreserveBar(s: String): String
def isASTLike(any: Any): Boolean
def isIR(any: Any): Boolean
def process(title: String, astLike: Any): String