0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 05:32:41 +00:00

fix error issue

This commit is contained in:
Charlie Humphreys
2023-01-23 14:22:18 -06:00
parent 6ddf0bb889
commit 8f75ea4728
6 changed files with 10 additions and 9 deletions

View File

@@ -22,13 +22,14 @@ const ErrorNavItem = createClass({
};
const error = this.props.error;
const status = error.status;
const message = error.body?.message;
const response = error.response;
const status = response.status;
const message = response.body?.message;
let errMsg = '';
try {
errMsg += `${error.toString()}\n\n`;
errMsg += `\`\`\`\n${error.stack}\n`;
errMsg += `${JSON.stringify(error.error, null, ' ')}\n\`\`\``;
errMsg += `${JSON.stringify(response.error, null, ' ')}\n\`\`\``;
console.log(errMsg);
} catch (e){}
@@ -48,7 +49,7 @@ const ErrorNavItem = createClass({
</Nav.item>;
}
if(error.req.url.match(/^\/api.*Google.*$/m)){
if(response.req.url.match(/^\/api.*Google.*$/m)){
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
Oops!
<div className='errorContainer' onClick={clearError}>