From bbf86d25da61d105183e733c9533c763fd4c52d2 Mon Sep 17 00:00:00 2001 From: Rafa Mel Date: Tue, 7 May 2019 11:46:44 +0200 Subject: [PATCH] feat(utils/errors): uses source as message when it's a string --- src/utils/errors.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/errors.ts b/src/utils/errors.ts index f0ddbac..22035eb 100644 --- a/src/utils/errors.ts +++ b/src/utils/errors.ts @@ -9,6 +9,7 @@ export class KpoError extends Error { if (typeof source === 'object' && source !== null) { message = (source as any).message; } + if (!message && typeof source === 'string') message = source; if (!message) message = 'An error occurred'; }