From 554c9eb42b85f8e80944732834c5c94fb8f4eba3 Mon Sep 17 00:00:00 2001 From: Shabalin Dmitriy Date: Fri, 1 Sep 2023 14:50:53 +0300 Subject: [PATCH] fix: add nats error code to error message --- src/Client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.ts b/src/Client.ts index 8fafc11..b1ba99f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -187,7 +187,7 @@ export class Client extends Root { : await this.makeBrokerRequest(subject, message, timeout); if (result.error) { - throw new Error(result.error.message); + throw new Error(result.error.message ?? result.error); } if (options?.runTimeValidation?.response && response) {