-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: enso-org/cloud-v2#1630 This PR disables the refreshing the session if user is offline
- Loading branch information
1 parent
dcc7595
commit 3932679
Showing
22 changed files
with
443 additions
and
274 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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* An error that occurs when a network request fails. | ||
* | ||
* This error is used to indicate that a network request failed due to a network error, | ||
* such as a timeout or a connection error. | ||
*/ | ||
export class NetworkError extends Error { | ||
/** | ||
* Create a new {@link NetworkError} with the specified message. | ||
* @param message - The message to display when the error is thrown. | ||
*/ | ||
constructor(message: string, options?: ErrorOptions) { | ||
super(message, options) | ||
this.name = 'NetworkError' | ||
} | ||
} | ||
|
||
/** | ||
* An error that occurs when the user is offline. | ||
* | ||
* This error is used to indicate that the user is offline, such as when they are | ||
* not connected to the internet or when they are on an airplane. | ||
*/ | ||
export class OfflineError extends Error { | ||
/** | ||
* Create a new {@link OfflineError} with the specified message. | ||
* @param message - The message to display when the error is thrown. | ||
*/ | ||
constructor(message: string = 'User is offline', options?: ErrorOptions) { | ||
super(message, options) | ||
this.name = 'OfflineError' | ||
} | ||
} | ||
|
||
/** | ||
* An error with a display message. | ||
* | ||
* This message can be shown to a user. | ||
*/ | ||
export class ErrorWithDisplayMessage extends Error { | ||
readonly displayMessage: string | ||
/** | ||
* Create a new {@link ErrorWithDisplayMessage} with the specified message and display message. | ||
* @param message - The message to display when the error is thrown. | ||
* @param options - The options to pass to the error. | ||
*/ | ||
constructor(message: string, options: ErrorOptions & { displayMessage: string }) { | ||
super(message, options) | ||
this.name = 'ErrorWithDisplayMessage' | ||
this.displayMessage = options.displayMessage | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.