Class MemcoPreconditionFailedError
Hierarchy (View Summary)
- MemcoAPIError
- MemcoPreconditionFailedError
Constructors
constructor
-
new MemcoPreconditionFailedError(
code: Status,
detail: string,
debugErrorString?: string,
metadata?: Readonly<Record<string, string>>,
): MemcoPreconditionFailedErrorParameters
- code: Status
- detail: string
OptionaldebugErrorString: string- metadata: Readonly<Record<string, string>> = {}
Returns MemcoPreconditionFailedError
Properties
Readonlycode
code: Status
The gRPC status code, as @grpc/grpc-js's numeric status enum.
ReadonlycodeName
codeName: string
The status code's name, such as UNAUTHENTICATED.
Readonlydetail
detail: string
The service's own description of the failure, without the code prefix.
ReadonlydebugErrorString
debugErrorString: string | undefined
gRPC's internal diagnostic string, when the call carried one.
Readonlymetadata
metadata: Readonly<Record<string, string>>
The detail the service attached to the refusal, key to value, such as the network a user is already in. Empty when it attached none. Frozen, and the service's to extend: a key this SDK does not name is still here.
The service refused because the caller's state does not allow the call.
Billing, account standing, terms, a resource in the wrong state — something outside the request has to change, so neither a retry nor a different argument gets past it.
detailis the service's own account of what that is.Three cases the service names with a structured reason are modelled as subclasses: a sunset, as MemcoSunsetError, and the two refusals to place a user in a network, MemcoUserAlreadyAssignedNetworkError and MemcoExternalUserNeedsCustomerNetworkError. An
instanceofchain testing this class first never reaches them, and comparingnameagainst'MemcoPreconditionFailedError'never matches them at all. Test for them explicitly, either way.