mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Add better support for non-native errors
This commit is contained in:
@@ -88,7 +88,7 @@ describe('A BaseHttpServerFactory', (): void => {
|
||||
handler.handleSafe.mockRejectedValueOnce('apple');
|
||||
|
||||
const res = await request(server).get('/').expect(500);
|
||||
expect(res.text).toContain('Unknown error.');
|
||||
expect(res.text).toContain('Unknown error: apple.');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -107,7 +107,7 @@ describe('A BaseHttpServerFactory', (): void => {
|
||||
server.close();
|
||||
});
|
||||
|
||||
it('throws unknown errors if its handler throw non-Error objects.', async(): Promise<void> => {
|
||||
it('does not print the stack if that option is disabled.', async(): Promise<void> => {
|
||||
const error = new Error('dummyError');
|
||||
handler.handleSafe.mockRejectedValueOnce(error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user