Display the correct error message
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user