SyntaxError (class)
public SyntaxError {inherits Error}
Package: CURL.LANGUAGE.EXCEPTIONS
Direct Known Subclasses: PackageBindingError, CircularImportError, ComponentMismatchError, AmbiguousNameError, QuantityParseError

The class of Exceptions that are thrown when syntax errors occur.


Constructors
default:Construct a SyntaxError.
constructor public {SyntaxError.default
    problem:String,
    url:#Url,
    line:int,
    column:int
}
with-location:Construct error taking location info from single variable
constructor public {SyntaxError.with-location
    where:#BaseSourceLocation,
    problem:String,
    error-name:#String = null
}
Properties
column:The column number in line.
accessor public final SyntaxError.column:int
error-name:String containing an error code.
field public constant SyntaxError.error-name:#String
error-type:
accessor public SyntaxError.error-type:SyntaxErrorType
line:The line number in url.
accessor public final SyntaxError.line:int
problem:A human readable message.
accessor public final SyntaxError.problem:String
url:The file which caused the error, if known.
accessor public final SyntaxError.url:#Url
where:Location in source of error, if known.
field public-get hidden-set transient SyntaxError.where:#BaseSourceLocation
Properties inherited from BasicThrowable: message, value
Methods
object-describe:Describes an object in a way that is suitable for printing by the user.
public {SyntaxError.object-describe
    out:TextOutputStream,
    locale:Locale
}:void
Methods inherited from Object: object-describe-for-debugging, object-serialize

Constructor Details
default (constructor)
public {SyntaxError.default
    problem:String,
    url:#Url,
    line:int,
    column:int
}

Construct a SyntaxError.

problem: A human readable message, to which the location information is prepended to produce Exception.message.
url: The Url of the resource that the error occurred in. This may be null if this information is unavailable. The Url represents Curl Language source code or some Url relevant to where the error occurred.
line: Line number in url where the error occurred.
column: Column number in line where the error occurred.


with-location (constructor)
public {SyntaxError.with-location
    where:#BaseSourceLocation,
    problem:String,
    error-name:#String = null
}

Construct error taking location info from single variable

where: specifies the source location of the error. This will be saved in the corresponding where field, and will be used to compute the values of url, line and column.
problem: is a human readable string describing the error, which may be translated into the host language.
error-name: is a string containing a code name for the error intended to uniquely identify the type of error.

Description

Like SyntaxError.default constructor except that it takes the url, line and column from the location variable using its BaseSourceLocation.get-url-line-column method. The computation of the url, line and column is deferred until it is needed, that is, until one of those getters is accessed or the error is printed.
Introduced in: version 6.0


Property Details
column (accessor)
accessor public final SyntaxError.column:int

The column number in line.

Notes

If url is null, there is no location information.


error-name (field)
public constant SyntaxError.error-name:#String

String containing an error code.

Description

This is only set by the with-location constructor, and otherwise will be null.

If non-null, this will contain a string that identifies the type of error.
Introduced in: version 6.0


error-type (accessor)
accessor public SyntaxError.error-type:SyntaxErrorType
This item is unsupported and reserved for internal use.
Introduced in: version 6.0


line (accessor)
accessor public final SyntaxError.line:int

The line number in url.

Notes

If url is null, there is no location information.


problem (accessor)
accessor public final SyntaxError.problem:String

A human readable message.

Description

This is the same as message.


url (accessor)
accessor public final SyntaxError.url:#Url

The file which caused the error, if known.

Notes

If url is null, there is no location information.


where (field)
public-get hidden-set transient SyntaxError.where:#BaseSourceLocation

Location in source of error, if known.

Description

This field contains the location of the error in the source code represented as a BaseSourceLocation object. This will only be non-null if the error was initialized using the with-location constructor. If non-null, it will be used to compute the url, line and column attributes.
Introduced in: version 6.0


Method Details
object-describe (method)
public {SyntaxError.object-describe
    out:TextOutputStream,
    locale:Locale
}:void

Describes an object in a way that is suitable for printing by the user.

out: The stream to which the characters are sent.
locale: The Locale that controls how self is displayed.

Description

This method is generally invoked indirectly using the "%s" format key.

{format out = out, "%s", obj}
simply calls
{obj.object-describe out}.


For example, if u is a Url,
{u.object-describe os}
writes u's name to os.

The default implementation of this method has the effect of calling
{format out = out, locale = locale, "%v", obj }
(see format for details about the "%v" format key).