Class IrisException
Javadoc 27 generates this reference during each site build from the exported packages and the annotation processor. The Java guide shows the API in use.
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.gecode.iris.IrisException
- All Implemented Interfaces:
Serializable
Thrown for an error in a reader spec, or in an input that a reader spec reads.
origin(), line() and column() give the location that Throwable.getMessage()
shows: the one in the input if the error has it, and otherwise the one in the reader spec. error gives both.
An error from a reader spec that a spec builder made also names the line of the host program
that wrote the statement the error belongs to: callSite returns it, and Throwable.getMessage() ends with it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncallSite()Returns the line of the host program that wrote the statement the error belongs to, if the reader spec comes from a spec builder.code()Returns the stable code of the error.@Nullable Integercolumn()Returns the column in bytes, counted from 1, or null if the error does not report one.error()Returns the details of the error.@Nullable Integerline()Returns the line, counted from 1, or null if the error does not report one.@Nullable Stringorigin()Returns the name of the source, or null if the error does not report one.path()Returns the indices of a failed check's witness, or null for any other error.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
IrisException
Creates an exception reportingerror.- Parameters:
error- the details of the error
-
-
Method Details
-
error
-
code
-
origin
Returns the name of the source, or null if the error does not report one.- Returns:
- the name of the source, or null if the error does not report one
-
line
Returns the line, counted from 1, or null if the error does not report one.- Returns:
- the line, counted from 1, or null if the error does not report one
-
column
Returns the column in bytes, counted from 1, or null if the error does not report one.- Returns:
- the column in bytes, counted from 1, or null if the error does not report one
-
path
-
callSite
Returns the line of the host program that wrote the statement the error belongs to, if the reader spec comes from a spec builder.It is the statement's
BuildException.callSite. A reader spec parsed from text has no call sites, and neither has an error that belongs to no statement, such as unexpected input after the end of the spec.- Returns:
- the line of the host program that wrote the statement the error belongs to, if the reader spec comes from a spec builder
-