CybrLabsError. Invalid arguments, such as an empty key, throw TypeError. The browser terminal client reports Error and TerminalRefusedError instead.
Error fields
Codes
toPublicError(error, options?)
Returns { status, body } that is safe to send to a learner’s browser. body is { code, message, retryAfter?, backendCode? }. The message is fixed copy.
httpStatusFor(error) returns only the status.
Public backend codes
With{ includeBackendCode: true }, the body adds backendCode when it is on the PUBLIC_BACKEND_CODES list:
The list is exported as
PUBLIC_BACKEND_CODES, and its type as PublicBackendCode.
Backend codes for the terminal
createTerminalSession() maps terminal codes to these SDK codes:
handleTerminalSession turns these into the refusal reasons the browser client reads.