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:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user