Ballerina API Documentation

Functions of ballerina.lang.exceptions package

function getCategory(exception e) (string )

Gets the category of an exception

Parameters:

Parameter NameData TypeDescription
eexceptionThe exception object

Return Parameters:

Return VariableData TypeDescription
stringstring): The exception category

function getMessage(exception e) (string )

Set message to an exception.

Parameters:

Parameter NameData TypeDescription
eexceptionThe exception object

Return Parameters:

Return VariableData TypeDescription
stringstring): The exception message

function getStackTrace(exception e) (string )

Gets the exception stack trace with the cause

Parameters:

Parameter NameData TypeDescription
eexceptionThe exception object

Return Parameters:

Return VariableData TypeDescription
stringstring) : The exception stacktrace

function set(exception e, string m, string category)

Set the message and the category.

Parameters:

Parameter NameData TypeDescription
eexceptionThe exception object
mstringe: The exception object
categorystringThe exception category to be added

function setCategory(exception e, string category)

Set the category of an exception.

Parameters:

Parameter NameData TypeDescription
eexceptionThe exception object
categorystringThe exception category to be added

function setCause(exception e, exception cause)

Sets cause of the specified exception

Parameters:

Parameter NameData TypeDescription
eexceptionThe exception object
causeexceptionThe exception cause to be added

function setMessage(exception e, string m)

Sets exception message specified exception

Parameters:

Parameter NameData TypeDescription
eexceptionThe exception object
mstringe: The exception object


Menu

  • Functions
    • getCategory(exception e) (string )
    • getMessage(exception e) (string )
    • getStackTrace(exception e) (string )
    • set(exception e, string m, string category)
    • setCategory(exception e, string category)
    • setCause(exception e, exception cause)
    • setMessage(exception e, string m)

Copyright 2017 Ballerina API Documentation