Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlovdog committed Jan 3, 2025
1 parent b286c27 commit 9374890
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/cli/alto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
serverOptions
} from "./config"
import { registerCommandToYargs } from "./util"
import { TimeoutError, HttpRequestError, InternalRpcError } from "viem"

// Load environment variables from .env file
if (process.env.DOTENV_CONFIG_PATH) {
Expand All @@ -23,14 +24,26 @@ if (process.env.DOTENV_CONFIG_PATH) {
}

if (process.env.SENTRY_DSN) {
const SENTRY_IGNORE_ERRORS = [
InternalRpcError,
HttpRequestError,
TimeoutError
]

sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.ENVIRONMENT,
ignoreErrors: [
"RpcRequestError",
"ResourceNotFoundRpcError",
"HttpRequestError",
]
beforeSend(event, hint) {
if (
SENTRY_IGNORE_ERRORS.some(
(error) => hint.originalException instanceof error
)
) {
return null
}

return event
}
})
}

Expand Down

0 comments on commit 9374890

Please sign in to comment.