-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from nsidc/error-handling
Error handling
- Loading branch information
Showing
10 changed files
with
217 additions
and
139 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,21 @@ | ||
type ErrorFallbackParams = {error: Error, resetErrorBoundary: () => void}; | ||
const ErrorFallbackComponent = ({error, resetErrorBoundary}: ErrorFallbackParams) => ( | ||
<div role="alert" className="error"> | ||
<h3>Woops!</h3> | ||
|
||
<div className="error-message">{error.message}</div> | ||
|
||
<p> | ||
It's likely this application is down because other web services it depends on are currently down. | ||
Refresh the page later to try again. | ||
</p> | ||
|
||
<p><b> | ||
{"Please contact "} | ||
<a href="mailto:[email protected]">NSIDC User Services</a> | ||
{" if you need additional assistance."} | ||
</b></p> | ||
</div> | ||
); | ||
|
||
export default ErrorFallbackComponent; |
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
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,14 @@ | ||
.error { | ||
margin: 10px; | ||
} | ||
|
||
.error-message { | ||
font-family: monospace; | ||
white-space: pre; | ||
|
||
margin: 10px; | ||
padding: 10px; | ||
|
||
background-color: whitesmoke; | ||
color: red; | ||
} |