aboutsummaryrefslogtreecommitdiff
path: root/vnext/server/middleware
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-11-03 04:06:45 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:58 +0300
commit6a57c01e63d119a2bf90ba50cd69968807c076b0 (patch)
treee3788d4d1237d5f2efab3c0afc4cfa9a974fadbe /vnext/server/middleware
parentfc6b4023e963f2afcdb6393b95b83de39fbd5c22 (diff)
Handle oembed timeouts
Diffstat (limited to 'vnext/server/middleware')
-rw-r--r--vnext/server/middleware/oembed.js5
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();
});
};