Skip to content

Commit 9ad93b7

Browse files
committed
conat service could crash when trying to send an error if client is gone -- fix that
1 parent decdd34 commit 9ad93b7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/packages/conat/service/service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ export class ConatService extends EventEmitter {
210210
await mesg.respond(resp);
211211
} catch (err) {
212212
const data = { error: `${err}` };
213-
await mesg.respond(data);
213+
try {
214+
await mesg.respond(data);
215+
} catch (err2) {
216+
// do not crash on sending an error report:
217+
logger.debug("WARNING: unable to send error", this.name, err, err2);
218+
}
214219
}
215220
}
216221
};

0 commit comments

Comments
 (0)