From 2d58075d46348cf94c255c05f19559ac4f010354 Mon Sep 17 00:00:00 2001 From: Dominik Henneke Date: Tue, 13 Jul 2021 16:48:20 +0200 Subject: [PATCH] Display the correct error message Signed-off-by: Dominik Henneke --- plugins/techdocs/src/client.test.ts | 4 ++-- plugins/techdocs/src/client.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/techdocs/src/client.test.ts b/plugins/techdocs/src/client.test.ts index 4cc7aca6a6..982c9496b2 100644 --- a/plugins/techdocs/src/client.test.ts +++ b/plugins/techdocs/src/client.test.ts @@ -242,8 +242,8 @@ describe('TechDocsStorageClient', () => { .instances[0] as jest.Mocked; instance.onerror({ - status: 500, - message: 'Some other error', + type: 'error', + data: 'Some other error', } as any); await expect(promise).rejects.toThrow(Error); diff --git a/plugins/techdocs/src/client.ts b/plugins/techdocs/src/client.ts index 29e6e018d0..afbf4b74a0 100644 --- a/plugins/techdocs/src/client.ts +++ b/plugins/techdocs/src/client.ts @@ -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; } };