GrpcStatusCode
const GrpcStatusCode: { ABORTED: 10; ALREADY_EXISTS: 6; CANCELLED: 1; DEADLINE_EXCEEDED: 4; FAILED_PRECONDITION: 9; INTERNAL: 13; INVALID_ARGUMENT: 3; NOT_FOUND: 5; OK: 0; PERMISSION_DENIED: 7; RESOURCE_EXHAUSTED: 8; UNAUTHENTICATED: 16; UNAVAILABLE: 14; UNKNOWN: 2;};Defined in: errors.ts:39
Well-known gRPC status codes commonly seen from Spark Connect.
Use this object for comparisons against SparkConnectError.code instead of magic numbers.
Type Declaration
Section titled “Type Declaration”ABORTED
Section titled “ABORTED”readonly ABORTED: 10 = 10;ALREADY_EXISTS
Section titled “ALREADY_EXISTS”readonly ALREADY_EXISTS: 6 = 6;CANCELLED
Section titled “CANCELLED”readonly CANCELLED: 1 = 1;DEADLINE_EXCEEDED
Section titled “DEADLINE_EXCEEDED”readonly DEADLINE_EXCEEDED: 4 = 4;FAILED_PRECONDITION
Section titled “FAILED_PRECONDITION”readonly FAILED_PRECONDITION: 9 = 9;INTERNAL
Section titled “INTERNAL”readonly INTERNAL: 13 = 13;INVALID_ARGUMENT
Section titled “INVALID_ARGUMENT”readonly INVALID_ARGUMENT: 3 = 3;NOT_FOUND
Section titled “NOT_FOUND”readonly NOT_FOUND: 5 = 5;readonly OK: 0 = 0;PERMISSION_DENIED
Section titled “PERMISSION_DENIED”readonly PERMISSION_DENIED: 7 = 7;RESOURCE_EXHAUSTED
Section titled “RESOURCE_EXHAUSTED”readonly RESOURCE_EXHAUSTED: 8 = 8;UNAUTHENTICATED
Section titled “UNAUTHENTICATED”readonly UNAUTHENTICATED: 16 = 16;UNAVAILABLE
Section titled “UNAVAILABLE”readonly UNAVAILABLE: 14 = 14;UNKNOWN
Section titled “UNKNOWN”readonly UNKNOWN: 2 = 2;Example
Section titled “Example”try { await df.collect();} catch (err) { if (err instanceof SparkConnectError && err.code === GrpcStatusCode.UNAVAILABLE) { // retry or surface a degraded-mode error }}