MCPcopy Create free account
hub / github.com/NativeScript/firebase / errorToCode

Function errorToCode

packages/firebase-functions/index.android.ts:46–105  ·  view source on GitHub ↗
(error: com.google.firebase.functions.FirebaseFunctionsException.Code)

Source from the content-addressed store, hash-verified

44});
45
46function errorToCode(error: com.google.firebase.functions.FirebaseFunctionsException.Code) {
47 let code = HttpsErrorCode.UNKNOWN;
48 switch (error) {
49 case com.google.firebase.functions.FirebaseFunctionsException.Code.OK:
50 code = HttpsErrorCode.OK;
51 break;
52 case com.google.firebase.functions.FirebaseFunctionsException.Code.CANCELLED:
53 code = HttpsErrorCode.CANCELLED;
54 break;
55 case com.google.firebase.functions.FirebaseFunctionsException.Code.UNKNOWN:
56 code = HttpsErrorCode.UNKNOWN;
57 break;
58 case com.google.firebase.functions.FirebaseFunctionsException.Code.INVALID_ARGUMENT:
59 code = HttpsErrorCode.INVALID_ARGUMENT;
60 break;
61 case com.google.firebase.functions.FirebaseFunctionsException.Code.DEADLINE_EXCEEDED:
62 code = HttpsErrorCode.DEADLINE_EXCEEDED;
63 break;
64 case com.google.firebase.functions.FirebaseFunctionsException.Code.NOT_FOUND:
65 code = HttpsErrorCode.NOT_FOUND;
66 break;
67 case com.google.firebase.functions.FirebaseFunctionsException.Code.ALREADY_EXISTS:
68 code = HttpsErrorCode.ALREADY_EXISTS;
69 break;
70 case com.google.firebase.functions.FirebaseFunctionsException.Code.PERMISSION_DENIED:
71 code = HttpsErrorCode.PERMISSION_DENIED;
72 break;
73 case com.google.firebase.functions.FirebaseFunctionsException.Code.RESOURCE_EXHAUSTED:
74 code = HttpsErrorCode.RESOURCE_EXHAUSTED;
75 break;
76 case com.google.firebase.functions.FirebaseFunctionsException.Code.FAILED_PRECONDITION:
77 code = HttpsErrorCode.FAILED_PRECONDITION;
78 break;
79 case com.google.firebase.functions.FirebaseFunctionsException.Code.ABORTED:
80 code = HttpsErrorCode.ABORTED;
81 break;
82 case com.google.firebase.functions.FirebaseFunctionsException.Code.OUT_OF_RANGE:
83 code = HttpsErrorCode.OUT_OF_RANGE;
84 break;
85 case com.google.firebase.functions.FirebaseFunctionsException.Code.UNIMPLEMENTED:
86 code = HttpsErrorCode.UNIMPLEMENTED;
87 break;
88 case com.google.firebase.functions.FirebaseFunctionsException.Code.INTERNAL:
89 code = HttpsErrorCode.INTERNAL;
90 break;
91 case com.google.firebase.functions.FirebaseFunctionsException.Code.UNAVAILABLE:
92 code = HttpsErrorCode.UNAVAILABLE;
93 break;
94 case com.google.firebase.functions.FirebaseFunctionsException.Code.DATA_LOSS:
95 code = HttpsErrorCode.DATA_LOSS;
96 break;
97 case com.google.firebase.functions.FirebaseFunctionsException.Code.UNAUTHENTICATED:
98 code = HttpsErrorCode.UNAUTHENTICATED;
99 break;
100 default:
101 break;
102 }
103

Callers 1

toHttpsErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected