-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remember redirect on login & improve sentry compatibility
- Loading branch information
1 parent
2522f47
commit 3b770bb
Showing
5 changed files
with
50 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { captureException, close } from '@sentry/vue' | ||
import { H3Error } from 'h3' | ||
|
||
const IGNORED_STATUS_CODES = [404, 422] | ||
|
||
export default defineNitroPlugin(nitroApp => { | ||
nitroApp.hooks.hook('error', error => { | ||
if (error instanceof H3Error) { | ||
if (IGNORED_STATUS_CODES.includes(error.statusCode)) { | ||
return | ||
} | ||
} | ||
|
||
captureException(error) | ||
}) | ||
|
||
nitroApp.hooks.hookOnce('close', async () => { | ||
await close(2000) | ||
}) | ||
}) |