Errors¶
Error
is the parent type for errors in Chapel. TaskErrors
is the type of errors thrown from parallel constructs where more than one
error can be simultaneously encountered.
-
class
Error
¶ Error
is the base class for errors-
proc
Error
()¶ Construct an Error
-
proc
message
()¶ Override this method to provide an error message in case the error is printed out or never caught.
-
proc
writeThis
(f)¶ Errors can be printed out. In that event, they will show information about the error including the result of calling
Error.message
.
-
proc
-
class
NilThrownError
: Error¶ If a nil
Error
is thrown,NilThrownError
will be thrown instead.
-
class
TaskErrors
: Error¶ TaskErrors
stores multiple errors when they can come up. For example, acoforall
loop might throw errors from multiple tasks at the same time. These errors will be reported to the parent task at the end of thecoforall
in the form ofTaskErrors
.Note that errors thrown within a
coforall
,cobegin
, orforall
are represented as elements ofTaskErrors
. In the case of nesting, all errors will be stored in a singleTaskErrors
.Errors thrown in
begin
tasks will be reported within aTaskErrors
to the task that usessync
to wait for thosebegin
tasks.-
proc
append
(err: Error)¶ append a single error to the group
-
proc
TaskErrors
(err: Error)¶ Create a
TaskErrors
containing only the passed error
-
proc
TaskErrors
() Create a
TaskErrors
not containing any errors
-
iter
these
()¶ Iterate over the errors contained in this
TaskErrors
. For examplevar taskErrors:TaskErrors = ...; for containedError in taskErrors { // Do something with the contained error }
-
proc
message
(): string¶ Returns a string summarizing the errors contained in this
TaskErrors
. The summary is intended to be concise: it will not grow arbitrarily long if theTaskErrors
contains many errors.
-
iter
filter
(type t)¶ Iterate over those errors contained that are the passed type or a subclass of that type.
-
proc
contains
(type t)¶ Returns true if this
TaskErrors
contains an error of the given type or a subclass of that type.
-
proc