Error

class Error

Represents and error in the request/response cycle

msg: str

The original error message

msg_with_line: str

The original error message with the file/line number

status: number

The http status code to use for this response defaults to 500

traceback: str

The stacktrace for this error

static assert(test, msg, status)

Wrapper around assert that coverts the

message into an pipe sepereted list this format will be used by Error.pcall to reconstruct an Error if any calls to assert raise an error

Parameters
  • test (boolean) –

  • msg (str) –

  • status (number) – defualts to 500

static raise(msg, status)

Raise and error with a message and status

Parameters
  • msg (str) –

  • status (number) –

static pcall()

Wrapper around pcall that will reconstruct the Error object

on failure

Return type

Error or str