Package dev.cel.common.internal
Class Errors.Error
- java.lang.Object
-
- dev.cel.common.internal.Errors.Error
-
- Enclosing class:
- Errors
@Immutable public static class Errors.Error extends java.lang.Object
Represents an error. An error is associated with a context, a position, and a message. This information is opaque currently, and the only public method on an error is to convert it into a string.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
exprId()
Returns the expression ID associated with this error.int
position()
Returns the code point position assigned to the expression with the error.java.lang.String
rawMessage()
Returns the raw error message without the container or line number.java.lang.String
toDisplayString(@Nullable Errors.ErrorFormatter formatter)
Formats the error into a string which indicates where it occurs within the expression.java.lang.String
toString()
-
-
-
Method Detail
-
position
public int position()
Returns the code point position assigned to the expression with the error.
-
rawMessage
public java.lang.String rawMessage()
Returns the raw error message without the container or line number.
-
exprId
public long exprId()
Returns the expression ID associated with this error. May return 0 if the error is not caused by an expression (ex: environment misconfiguration).
-
toDisplayString
public java.lang.String toDisplayString(@Nullable Errors.ErrorFormatter formatter)
Formats the error into a string which indicates where it occurs within the expression.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-