-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reject promise if eager connection fails (#1177)
* chore: reject promise if eager connection fails
- Loading branch information
1 parent
3288e19
commit d25c68e
Showing
4 changed files
with
51 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ export enum MomentoErrorCode { | |
AUTHENTICATION_ERROR = 'AUTHENTICATION_ERROR', | ||
// Request was cancelled by the server | ||
CANCELLED_ERROR = 'CANCELLED_ERROR', | ||
// Error connecting to Momento servers | ||
CONNECTION_ERROR = 'CONNECTION_ERROR', | ||
// Request rate, bandwidth, or object size exceeded the limits for the account | ||
LIMIT_EXCEEDED_ERROR = 'LIMIT_EXCEEDED_ERROR', | ||
// Request was invalid | ||
|
@@ -118,6 +120,13 @@ export class CancelledError extends SdkError { | |
'The request was cancelled by the server; please contact us at [email protected]'; | ||
} | ||
|
||
/** | ||
* Error when there's a failure to connect to Momento servers. | ||
*/ | ||
export class ConnectionError extends SdkError { | ||
_errorCode = MomentoErrorCode.CONNECTION_ERROR; | ||
} | ||
|
||
/** | ||
* Error raised when system in not in a state required for the operation's success | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters