Functions

cause
I

Returns the error's cause.

detail
I

Returns the error's detail record.

message
I

Returns the error's message.

stackTrace
I

Returns an object representing the stack trace of the error.

toBalString
I

Converts an error to a string that describes the value in Ballerina syntax.

toString
I

Converts an error to a string.

cause

function cause(error e) returns error?
Isolated Function

Returns the error's cause.

Parameters

Return Type

(error?)

error cause

detail

function detail(error e) returns DetailType
Isolated Function

Returns the error's detail record.

The returned value will be immutable.

Parameters

Return Type

(DetailType)

error detail value

message

function message(error e) returns string
Isolated Function

Returns the error's message.

Parameters

Return Type

(string)

error message

stackTrace

function stackTrace(error e) returns CallStack
Isolated Function

Returns an object representing the stack trace of the error.

Parameters

Return Type

(CallStack)

a new object representing the stack trace of the error value

toBalString

function toBalString(error e) returns string
Isolated Function

Converts an error to a string that describes the value in Ballerina syntax.

The details of the conversion are specified by the ToString abstract operation defined in the Ballerina Language Specification, using the expression style.

Parameters

  • e error
  • the error to be converted to a string

Return Type

(string)

a string resulting from the conversion

toString

function toString(error e) returns string
Isolated Function

Converts an error to a string.

The details of the conversion are specified by the ToString abstract operation defined in the Ballerina Language Specification, using the direct style.

Parameters

  • e error
  • the error to be converted to a string

Return Type

(string)

a string resulting from the conversion