mirror of
https://github.com/Retropex/mempool.git
synced 2025-05-13 02:30:41 +02:00
[blocks] respect 404 error code instead of misleading 500
This commit is contained in:
parent
8b70e65717
commit
2945e47eba
@ -406,8 +406,8 @@ class BitcoinRoutes {
|
|||||||
|
|
||||||
res.setHeader('Expires', new Date(Date.now() + 1000 * cacheDuration).toUTCString());
|
res.setHeader('Expires', new Date(Date.now() + 1000 * cacheDuration).toUTCString());
|
||||||
res.json(block);
|
res.json(block);
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
handleError(req, res, 500, 'Failed to get block');
|
handleError(req, res, e?.response?.status === 404 ? 404 : 500, 'Failed to get block');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user