Skip to main content
Defined in: typescript/src/errors/AuthorizationError.ts:18 Raised when the Runtime returns HTTP 403 for a caller that is authenticated but not permitted to do the specific thing it asked for. Covers two distinct denials, both intentionally collapsed to this one SDK error class since both share the same “who you are is known; you can’t do this” shape — distinguish them via serverCode/ message if needed, not via instanceof:
  • a caller asserting an authority.principalId it isn’t permitted to assert (isPrincipalAllowed, packages/api/src/routes/execute.ts and transactions.ts) — carries no code field of its own.
  • a caller invoking a capability (intent.action) it isn’t permitted to invoke (isCapabilityAllowed.ts) — carries code: "CAPABILITY_NOT_ALLOWED", preserved on serverCode below. Distinct from AuthenticationError (401, no valid credential at all).

Extends

Constructors

Constructor

new AuthorizationError(message, options?): AuthorizationError
Defined in: typescript/src/errors/AuthorizationError.ts:27

Parameters

message
string
options?
requestId?
string
cause?
unknown
serverCode?
string

Returns

AuthorizationError

Overrides

ParmanaError.constructor

Properties

serverCode?

readonly optional serverCode?: string
Defined in: typescript/src/errors/AuthorizationError.ts:25 The Runtime’s own code field, when the 403 carried one (currently only the capability-denied case: “CAPABILITY_NOT_ALLOWED”). Undefined for the principal-mismatch case, which the Runtime sends with no code at all — see mapHttpErrorResponse.ts for the exact check.

code

readonly code: ErrorCode
Defined in: typescript/src/errors/ParmanaError.ts:61 Stable machine-readable error code.

Inherited from

ParmanaError.code

requestId?

readonly optional requestId?: string
Defined in: typescript/src/errors/ParmanaError.ts:66 Optional request identifier.

Inherited from

ParmanaError.requestId

cause?

readonly optional cause?: unknown
Defined in: typescript/src/errors/ParmanaError.ts:71 Optional underlying cause.

Inherited from

ParmanaError.cause

stackTraceLimit

static stackTraceLimit: number
Defined in: node_modules/@types/node/globals.d.ts:68 The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)). The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed. If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

ParmanaError.stackTraceLimit

name

name: string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

ParmanaError.name

message

message: string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

ParmanaError.message

stack?

optional stack?: string
Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

ParmanaError.stack

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void
Defined in: node_modules/@types/node/globals.d.ts:52 Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}. The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace. The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

Parameters

targetObject
object
constructorOpt?
Function

Returns

void

Inherited from

ParmanaError.captureStackTrace

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any
Defined in: node_modules/@types/node/globals.d.ts:56

Parameters

err
Error
stackTraces
CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

ParmanaError.prepareStackTrace