-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
14 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,8 @@ export default class ErrorBoundary extends React.Component { | |
|
||
render() { | ||
if (this.state.hasError) { | ||
const mailLink = `mailto:[email protected]?subject=ChatMap Error&body=Hi, something went wrong with chatmap: ${this.state.error.message}` | ||
const errorMsg = `${this.state.error.fileName}(${this.state.error.lineNumber}): \n ${this.state.error.toString()} \n ${this.state.error.stack}`; | ||
const mailLink = `mailto:[email protected]?subject=ChatMap Error&body=Hi, something went wrong with chatmap: ${errorMsg}` | ||
return ( | ||
<div className="errorMessage"> | ||
<header className="header"> | ||
|
@@ -26,13 +27,13 @@ export default class ErrorBoundary extends React.Component { | |
<strong className="highlighted">Please, send the detail below to <a href={mailLink}>[email protected]</a></strong> | ||
<br />or create an issue in <a href="https://github.com/hotosm/chatmap/issues">github.com/hotosm/chatmap/issues</a> | ||
</p> | ||
<code> | ||
<strong>Error:</strong> {this.state.error.message} | ||
</code> | ||
</div> | ||
<div className="buttons"> | ||
<a className="primaryButton" href={"/"}>Go back</a> | ||
<a className="secondaryButton" href={mailLink}>Send error report</a> | ||
<div className="buttons"> | ||
<a className="primaryButton" href={"/"}>Go back</a> | ||
<a className="secondaryButton" href={mailLink}>Send error report</a> | ||
</div> | ||
<pre> | ||
<strong>Error:</strong> {errorMsg} | ||
</pre> | ||
</div> | ||
</div> | ||
); | ||
|