-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathPlatformAgnostic.ts
More file actions
28 lines (26 loc) · 1.17 KB
/
Copy pathPlatformAgnostic.ts
File metadata and controls
28 lines (26 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { type AppIntegrityError, ErrorResolutionTypes } from './types'
export const unhandledException = (
originalMessage: string,
): AppIntegrityError & { originalMessage: string } => ({
originalMessage,
code: 'UNKNOWN',
errorCode: 26,
documentation: 'https://gihub.com/jeffDevelops/expo-app-integrity',
detail: `An unknown error occurred. See \`originalMessage\` for more information.`,
userFriendlyMessage:
'App integrity verification failed. An unknown error occurred. Error code: 26',
resolution:
'Retry with an exponential backoff. Consider filing an issue with the `expo-app-integrity` repository.',
resolutionType: ErrorResolutionTypes.DEVELOPER_ACTION_REQUIRED,
})
export const PlatformAgnosticErrors = {
UNSUPPORTED_PLATFORM: {
code: 'UNSUPPORTED_PLATFORM',
errorCode: 27,
documentation: 'https://gihub.com/jeffDevelops/expo-app-integrity',
detail: `The current platform is not supported by this library. Only 'ios' and 'android' are supported.`,
userFriendlyMessage: 'App integrity verification failed.',
resolution: 'Use this library only on iOS and Android.',
resolutionType: ErrorResolutionTypes.DEVELOPER_ACTION_REQUIRED,
},
}