Display the correct error message

Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
Dominik Henneke
2021-07-13 16:48:20 +02:00
parent 246b1797e5
commit 2d58075d46
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -242,8 +242,8 @@ describe('TechDocsStorageClient', () => {
.instances[0] as jest.Mocked<EventSource>;
instance.onerror({
status: 500,
message: 'Some other error',
type: 'error',
data: 'Some other error',
} as any);
await expect(promise).rejects.toThrow(Error);
+1 -1
View File
@@ -241,7 +241,7 @@ export class TechDocsStorageClient implements TechDocsStorageApi {
// also handles the event-stream close. the reject is ignored if the Promise was already
// resolved by a finish event.
default:
reject(new Error(e.message));
reject(new Error(e.data));
return;
}
};