mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
5f4c19da35
Co-authored-by: Opender Singh <opender.singh@konghq.com>
32 lines
682 B
TypeScript
32 lines
682 B
TypeScript
import { ValueOf } from 'type-fest';
|
|
|
|
export const GrpcStatusEnum = {
|
|
OK: 0,
|
|
CANCELLED: 1,
|
|
UNKNOWN: 2,
|
|
INVALID_ARGUMENT: 3,
|
|
DEADLINE_EXCEEDED: 4,
|
|
NOT_FOUND: 5,
|
|
ALREADY_EXISTS: 6,
|
|
PERMISSION_DENIED: 7,
|
|
RESOURCE_EXHAUSTED: 8,
|
|
FAILED_PRECONDITION: 9,
|
|
ABORTED: 10,
|
|
OUT_OF_RANGE: 11,
|
|
UNIMPLEMENTED: 12,
|
|
INTERNAL: 13,
|
|
UNAVAILABLE: 14,
|
|
DATA_LOSS: 15,
|
|
UNAUTHENTICATED: 16,
|
|
} as const;
|
|
|
|
type GrpcStatus = ValueOf<typeof GrpcStatusEnum>;
|
|
|
|
export interface GrpcStatusObject {
|
|
code: GrpcStatus;
|
|
details: string;
|
|
metadata: Record<string, any>; // https://grpc.github.io/grpc/node/grpc.Metadata.html
|
|
}
|
|
|
|
export type ServiceError = GrpcStatusObject & Error;
|