Something went wrong. Try again.
Client side atproto account migrator in your web browser, along with services for backups and adversarial migrations. pdsmoover.com
pds atproto migrations moo cow
Something went wrong. Try again.
1.1 kB · 22 lines
TypeScript
at main
1234567891011121314151617181920212223import * as Sentry from '@sentry/sveltekit'import type { Handle } from '@sveltejs/kit'import { sequence } from '@sveltejs/kit/hooks'import { ERROR_REPORTING_COOKIE, ERROR_REPORTING_OFF } from '$lib/errorReporting'
/** * Honours the error reporting opt-out cookie (set on the privacy policy page) on the server. An * event processor that returns null on the request's isolation scope drops every error event * raised while handling it, including those from handleError below. Traces for the same request * are dropped by the tracesSampler in instrumentation.server.ts, which is where server init lives. */const dropEventsWhenOptedOut: Handle = async ({ event, resolve }) => { if (event.cookies.get(ERROR_REPORTING_COOKIE) === ERROR_REPORTING_OFF) { Sentry.getIsolationScope().addEventProcessor(() => null) } return resolve(event)}
// sentryHandle() must come first: it forks the isolation scope the opt-out hook writes to.export const handle = sequence(Sentry.sentryHandle(), dropEventsWhenOptedOut)
export const handleError = Sentry.handleErrorWithSentry()