Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Nov 13, 2023
1 parent 205234e commit 0d00008
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/infra/_src/errorReporter.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { dropUndefined } from "@effect-app/core/utils"
import * as Sentry from "@sentry/node"
import { CauseException } from "./errors.js"
import { RequestContextContainer } from "./services/RequestContextContainer.js"
Expand All @@ -15,11 +16,11 @@ export function reportError(
yield* $(
cause
.logError
.annotateLogs({
.annotateLogs(dropUndefined({
extras,
// __cause__: error.toJSON(), // logs too much garbage
__error_name__: name
})
}))
)
})
}
Expand All @@ -46,17 +47,17 @@ export function logError<E>(
return (cause: Cause<E>, extras?: Record<string, unknown>) =>
Effect.gen(function*($) {
if (cause.isInterrupted()) {
yield* $(Effect.logDebug("Interrupted").annotateLogs("extras", JSON.stringify(extras ?? {})))
yield* $(Effect.logDebug("Interrupted").annotateLogs(dropUndefined({ extras })))
return
}
yield* $(
cause
.logWarning
.annotateLogs({
.annotateLogs(dropUndefined({
extras,
// __cause__: error.toJSON(), // logs too much garbage
__error_name__: name
})
}))
)
})
}
Expand Down

0 comments on commit 0d00008

Please sign in to comment.