@canva/error 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts
CHANGED
|
@@ -5,15 +5,18 @@ declare interface BaseCanvaError extends Error {
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @public
|
|
8
|
-
*
|
|
8
|
+
* An error thrown by the Apps SDK.
|
|
9
9
|
*/
|
|
10
10
|
export declare const CanvaError: typeof CanvaErrorClass;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* @public
|
|
14
|
-
*
|
|
14
|
+
* An error thrown by the Apps SDK.
|
|
15
15
|
*/
|
|
16
16
|
declare class CanvaErrorClass extends Error implements BaseCanvaError {
|
|
17
|
+
/**
|
|
18
|
+
* A code that identifies why the error was thrown.
|
|
19
|
+
*/
|
|
17
20
|
readonly code: ErrorCode;
|
|
18
21
|
|
|
19
22
|
constructor(opts: { code: ErrorCode; message: string });
|
|
@@ -21,57 +24,38 @@ declare class CanvaErrorClass extends Error implements BaseCanvaError {
|
|
|
21
24
|
|
|
22
25
|
/**
|
|
23
26
|
* @public
|
|
24
|
-
*
|
|
27
|
+
* An error code that identifies why an error was thrown by the Apps SDK.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* The possible error codes include:
|
|
31
|
+
*
|
|
32
|
+
* - `"bad_external_service_response"` - A response from an external service is invalid or malformed.
|
|
33
|
+
* - `"bad_request"` - The app made a request with invalid or malformed inputs.
|
|
34
|
+
* - `"failed_precondition"` - The requested operation can't be performed because a precondition hasn't been met.
|
|
35
|
+
* - `"internal_error"` - An error occurred within the Apps SDK's internal implementation.
|
|
36
|
+
* - `"not_found"` - The specified resource couldn't be found.
|
|
37
|
+
* - `"not_allowed"` - The app isn't allowed to perform the requested operation.
|
|
38
|
+
* - `"permission_denied"` - The app isn't allowed perform the requested operation because the appropriate permissions aren't set.
|
|
39
|
+
* - `"quota_exceeded"` - The app or user has exceeded their allocated quota for a resource or service.
|
|
40
|
+
* - `"rate_limited"` - The app attempted too many operations within a certain period of time.
|
|
41
|
+
* - `"timeout"` - The requested operation took too long to complete.
|
|
42
|
+
* - `"unsupported_surface"` - The requested operation isn't supported on the current surface.
|
|
43
|
+
* - `"unsupported_page_type"` - The requested operation isn't supported on the current page.
|
|
44
|
+
* - `"user_offline"` - The requested operation can't be performed because the user is offline.
|
|
25
45
|
*/
|
|
26
46
|
export declare type ErrorCode =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
| "
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| "
|
|
40
|
-
/**
|
|
41
|
-
* An error occurred within the SDK's internal implementation.
|
|
42
|
-
*/
|
|
43
|
-
| "INTERNAL_ERROR"
|
|
44
|
-
/**
|
|
45
|
-
* The allocated quota for the resource or service has been exceeded.
|
|
46
|
-
*/
|
|
47
|
-
| "QUOTA_EXCEEDED"
|
|
48
|
-
/**
|
|
49
|
-
* The system has received too many requests in a short period of time.
|
|
50
|
-
*/
|
|
51
|
-
| "RATE_LIMITED"
|
|
52
|
-
/**
|
|
53
|
-
* The caller does not have sufficient permissions to execute the specified operation.
|
|
54
|
-
*/
|
|
55
|
-
| "PERMISSION_DENIED"
|
|
56
|
-
/**
|
|
57
|
-
* The specified operation is not supported on the surface.
|
|
58
|
-
*/
|
|
59
|
-
| "UNSUPPORTED_SURFACE"
|
|
60
|
-
/**
|
|
61
|
-
* The user is currently offline and cannot perform the requested operation.
|
|
62
|
-
*/
|
|
63
|
-
| "USER_OFFLINE"
|
|
64
|
-
/**
|
|
65
|
-
* The specified resource was not found
|
|
66
|
-
*/
|
|
67
|
-
| "NOT_FOUND"
|
|
68
|
-
/**
|
|
69
|
-
* The specified operation was not allowed
|
|
70
|
-
*/
|
|
71
|
-
| "NOT_ALLOWED"
|
|
72
|
-
/**
|
|
73
|
-
* The operation exceeded the maximum allowed time to complete.
|
|
74
|
-
*/
|
|
75
|
-
| "TIMEOUT";
|
|
47
|
+
| "bad_external_service_response"
|
|
48
|
+
| "bad_request"
|
|
49
|
+
| "failed_precondition"
|
|
50
|
+
| "internal_error"
|
|
51
|
+
| "not_found"
|
|
52
|
+
| "not_allowed"
|
|
53
|
+
| "permission_denied"
|
|
54
|
+
| "quota_exceeded"
|
|
55
|
+
| "rate_limited"
|
|
56
|
+
| "timeout"
|
|
57
|
+
| "unsupported_surface"
|
|
58
|
+
| "unsupported_page_type"
|
|
59
|
+
| "user_offline";
|
|
76
60
|
|
|
77
61
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
"use strict";
|
|
1
|
+
"use strict"
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
3
|
value: true
|
|
5
4
|
});
|
|
@@ -17,5 +16,6 @@ function _export_star(from, to) {
|
|
|
17
16
|
});
|
|
18
17
|
return from;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
20
|
+
(_window___canva__ =
|
|
21
|
+
window.__canva__) === null || _window___canva__ === void 0 ? void 0 : (_window___canva___sdkRegistration = _window___canva__.sdkRegistration) === null || _window___canva___sdkRegistration === void 0 ? void 0 : _window___canva___sdkRegistration.registerPackageVersion('error', '2.0.0', 'ga');
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './public';
|
|
3
|
-
|
|
1
|
+
var _window___canva___sdkRegistration, _window___canva__;
|
|
2
|
+
export * from './public';
|
|
3
|
+
(_window___canva__ =
|
|
4
|
+
window.__canva__) === null || _window___canva__ === void 0 ? void 0 : (_window___canva___sdkRegistration = _window___canva__.sdkRegistration) === null || _window___canva___sdkRegistration === void 0 ? void 0 : _window___canva___sdkRegistration.registerPackageVersion('error', '2.0.0', 'ga');
|