throwException
Displays an error message at the bottom of the screen, logs the error, and rolls back the transaction.
This is a routes method for business service components.
Syntax
function throwException(message: string, code: number): void
| Parameter | Description |
|---|---|
message
|
Message to be displayed on screen and logged. |
code
|
Optional error code used for logging. |
Examples
In this example, we display the Unexpected error was logged error message, and log it under the error code 500.
throwException('Unexpected error was logged', 500);