mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
fix: tighten edge cases across services (#3158)
This commit is contained in:
1 parent
a9f7a23c0d
commit
4e6b837ccc
170 files changed
+2028
-421
No files matched your search
@@ -89,6 +89,17 @@ describe('AppErrorHandler logging', () => {
|
||||
expect(details.status).toBe(400);
|
||||
});
|
||||
|
||||
it('logs the matched route pattern instead of the request path', async () => {
|
||||
const app = createApp();
|
||||
app.get('/reset/:token', () => {
|
||||
throw new ServiceUnavailableError({message: 'unavailable'});
|
||||
});
|
||||
const response = await app.request('/reset/abc123');
|
||||
expect(response.status).toBe(503);
|
||||
expect(logCalls.error).toHaveLength(1);
|
||||
expect(logCalls.error[0]![0].path).toBe('/reset/:token');
|
||||
});
|
||||
|
||||
it('still reports unexpected errors as unhandled', async () => {
|
||||
const app = createApp();
|
||||
app.get('/thing', () => {
|
||||
|
||||
Reference in new issue
Block a user