Skip to content

Commit 8d54dc9

Browse files
neSpecce11sy
authored andcommitted
add logs to sentry worker
1 parent b6e85ed commit 8d54dc9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

workers/sentry/src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export default class SentryEventWorker extends Worker {
4141

4242
if (items.length === 0) {
4343
this.logger.warn('Received envelope with no items');
44-
4544
return;
4645
}
4746

@@ -50,7 +49,6 @@ export default class SentryEventWorker extends Worker {
5049

5150
for (const item of items) {
5251
const result = await this.handleEnvelopeItem(headers, item, event.projectId);
53-
5452
if (result === 'processed') {
5553
processedCount++;
5654
} else if (result === 'skipped') {
@@ -249,15 +247,16 @@ export default class SentryEventWorker extends Worker {
249247
if (!taskSent) {
250248
/**
251249
* If addTask returns false, the message was not queued (queue full or channel closed)
250+
* This is a critical error that should be logged and thrown
252251
*/
253252
const error = new Error(`Failed to queue event to ${workerName} worker. Queue may be full or channel closed.`);
254-
255253
this.logger.error(error.message);
256254
this.logger.info('👇 Here is the event that failed to queue:');
257255
this.logger.json(hawkEvent);
258256
throw error;
259257
}
260258

259+
this.logger.verbose(`Successfully queued event to ${workerName} worker`);
261260
return 'processed';
262261
} catch (error) {
263262
this.logger.error('Error handling envelope item:', error);

0 commit comments

Comments
 (0)