Skip to content

Commit a043b5c

Browse files
shabalindnShabalin Dmitriy
andauthored
fix: add nats error code to error message (#83)
Co-authored-by: Shabalin Dmitriy <[email protected]>
1 parent 8445fee commit a043b5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class Client<E extends Emitter = Emitter> extends Root {
187187
: await this.makeBrokerRequest(subject, message, timeout);
188188

189189
if (result.error) {
190-
throw new Error(result.error.message);
190+
throw new Error(result.error.message ?? result.error);
191191
}
192192

193193
if (options?.runTimeValidation?.response && response) {

0 commit comments

Comments
 (0)