-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Sentry config on the server side (#377)
* Re-export Sentry from init (DX) and call init from error endpoint to see if it fixes the issue with flush() timeout * Improve sentry init documentation + rollback to timeout 2s + auto-init Sentry when using configureReq * Implement better error handling on _error page (enrich Sentry metadata from req object) * Fix 404 error handling and reporting to Sentry * Improve documentation about error handling * Upgrade Sentry to latest (minor)
- Loading branch information
1 parent
9a4e137
commit 5ea63ac
Showing
10 changed files
with
131 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { IncomingMessage } from 'http'; | ||
import { NextApiRequest } from 'next'; | ||
|
||
/** | ||
* TS type guard resolving whether "req" matches a "NextApiRequest" object. | ||
* | ||
* @param req | ||
* | ||
* @see https://www.typescripttutorial.net/typescript-tutorial/typescript-type-guards/ | ||
* @see https://www.logicbig.com/tutorials/misc/typescript/type-guards.html | ||
*/ | ||
export const isNextApiRequest = (req: NextApiRequest | IncomingMessage): req is NextApiRequest => { | ||
return (req as NextApiRequest).body !== undefined; | ||
}; |
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
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