Skip to content

Commit 9c7ea7a

Browse files
committed
Unmute unprocessable span errors
1 parent b79340d commit 9c7ea7a

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

packages/core/src/jobs/job-definitions/documentSuggestions/generateDocumentSuggestionJob.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,8 @@ export const generateDocumentSuggestionJob = async (
6666
workspace: workspace,
6767
})
6868
if (result.error) {
69-
if (!(result.error instanceof UnprocessableEntityError)) {
70-
throw result.error
71-
}
72-
73-
if (process.env.NODE_ENV === 'development') {
69+
if (result.error instanceof UnprocessableEntityError) {
7470
captureException(result.error)
75-
}
71+
} else throw result.error
7672
}
7773
}

packages/core/src/jobs/job-definitions/tracing/ingestSpansJob.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ export const ingestSpansJob = async (job: Job<IngestSpansJobData>) => {
3030
const result = await ingestSpans({ spans, apiKeyId, workspaceId })
3131
if (result.error) {
3232
// @ts-expect-error ingestSpans currently ignores all errors but leaving this for the future
33-
if (!(result.error instanceof UnprocessableEntityError)) {
34-
throw result.error
35-
}
36-
37-
if (process.env.NODE_ENV === 'development') {
33+
if (result.error instanceof UnprocessableEntityError) {
3834
captureException(result.error)
39-
}
35+
} else throw result.error
4036
}
4137

4238
try {

packages/core/src/jobs/job-definitions/tracing/processSegmentJob.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const processSegmentJob = async (job: Job<ProcessSegmentJobData>) => {
5555
})
5656
if (result.error) {
5757
if (result.error instanceof UnprocessableEntityError) {
58-
if (process.env.NODE_ENV === 'development') captureException(result.error)
58+
captureException(result.error)
5959
} else if (result.error instanceof ConflictError) {
6060
const parts = job.deduplicationId!.split('-')
6161
const retries = Number(parts.at(-1) ?? 0)

packages/core/src/jobs/job-definitions/tracing/processSpanJob.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ export const processSpanJob = async (job: Job<ProcessSpanJobData>) => {
4242

4343
const result = await processSpan({ span, scope, apiKey, workspace })
4444
if (result.error) {
45-
if (!(result.error instanceof UnprocessableEntityError)) {
46-
throw result.error
47-
}
48-
49-
if (process.env.NODE_ENV === 'development') {
45+
if (result.error instanceof UnprocessableEntityError) {
5046
captureException(result.error)
51-
}
47+
} else throw result.error
5248
}
5349

5450
try {

0 commit comments

Comments
 (0)