diff options
author | Vitaly Takmazov | 2022-11-03 04:06:45 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:58 +0300 |
commit | 6a57c01e63d119a2bf90ba50cd69968807c076b0 (patch) | |
tree | e3788d4d1237d5f2efab3c0afc4cfa9a974fadbe /vnext/server/middleware | |
parent | fc6b4023e963f2afcdb6393b95b83de39fbd5c22 (diff) |
Handle oembed timeouts
Diffstat (limited to 'vnext/server/middleware')
-rw-r--r-- | vnext/server/middleware/oembed.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vnext/server/middleware/oembed.js b/vnext/server/middleware/oembed.js index 43bed194..ea53ca9c 100644 --- a/vnext/server/middleware/oembed.js +++ b/vnext/server/middleware/oembed.js @@ -11,9 +11,8 @@ const oembed = async (req, res) => { res.send(result); res.end(); }).catch(err => { - console.log(`Err: ${err.response.status}`); - res.status(err.response.status); - res.send({}); + console.log(`Err: ${err.response ? err.response.status : err.code}`); + res.sendStatus(err.response ? err.response.status : 500); res.end(); }); }; |