0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Send 500 error if Google doesn't send an error

Fixes crash where error did not contain the expected `response` field from Google.
This commit is contained in:
Trevor Buckner
2021-12-09 13:57:43 -05:00
parent dd93c4cdd4
commit a8f5f71b32

View File

@@ -178,7 +178,7 @@ const updateGoogleBrew = async (req, res, next)=>{
const updatedBrew = await GoogleActions.updateGoogleBrew(oAuth2Client, brew);
return res.status(200).send(updatedBrew);
} catch (err) {
return res.status(err.response.status).send(err);
return res.status(err.response?.status || 500).send(err);
}
};