We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cf5df3 commit da503bbCopy full SHA for da503bb
1 file changed
src/commands/send-event.ts
@@ -298,8 +298,17 @@ built entirely from the file contents.
298
);
299
}
300
const event = buildEventFromFlags(flags);
301
- const envelope = createEventEnvelope(event, dsnComponents);
302
- await sendEnvelopeRequest(dsn, serializeEnvelope(envelope));
+ let body: string | Uint8Array;
+ try {
303
+ const envelope = createEventEnvelope(event, dsnComponents);
304
+ body = serializeEnvelope(envelope);
305
+ } catch (err) {
306
+ throw new ValidationError(
307
+ `Failed to create event envelope: ${(err as Error).message}`,
308
+ "event"
309
+ );
310
+ }
311
+ await sendEnvelopeRequest(dsn, body);
312
yield new CommandOutput<SendEventResult>({
313
eventId: event.event_id ?? "",
314
});
0 commit comments