File tree Expand file tree Collapse file tree 3 files changed +357
-220
lines changed Expand file tree Collapse file tree 3 files changed +357
-220
lines changed Original file line number Diff line number Diff line change 3030 }
3131 ],
3232 "devDependencies" : {
33- "@sentry/node" : " 4.5.3 " ,
34- "@types/lodash" : " 4.14.120 " ,
35- "@types/node" : " 10. 12.18 " ,
36- "graphql" : " 14.1.1 " ,
37- "graphql-middleware" : " 3.0.0 " ,
38- "prettier" : " 1.16 .1" ,
33+ "@sentry/node" : " 5.2.0 " ,
34+ "@types/lodash" : " 4.14.130 " ,
35+ "@types/node" : " 12.0.2 " ,
36+ "graphql" : " 14.3.0 " ,
37+ "graphql-middleware" : " 3.0.2 " ,
38+ "prettier" : " 1.17 .1" ,
3939 "prettier-check" : " 2.0.0" ,
4040 "rimraf" : " 2.6.3" ,
41- "semantic-release" : " 15.13.3 " ,
42- "tslint" : " 5.12.1 " ,
43- "tslint-config-prettier" : " 1.17 .0" ,
41+ "semantic-release" : " 15.13.12 " ,
42+ "tslint" : " 5.16.0 " ,
43+ "tslint-config-prettier" : " 1.18 .0" ,
4444 "tslint-config-standard" : " 8.0.1" ,
45- "typescript" : " 3.2.4 "
45+ "typescript" : " 3.4.5 "
4646 },
4747 "license" : " MIT" ,
4848 "repository" : {
4949 "type" : " git" ,
5050 "url" : " https://github.com/BrunoScheufler/graphql-middleware-sentry.git"
5151 },
5252 "peerDependencies" : {
53- "@sentry/node" : " ^4.5 .0" ,
53+ "@sentry/node" : " ^5.2 .0" ,
5454 "graphql" : " ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0" ,
5555 "graphql-middleware" : " ^2.0.0 || ^3.0.0"
5656 }
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export type ExceptionScope<Context> = (
66 scope : Sentry . Scope ,
77 error : Error ,
88 context : Context ,
9- reportError ?: ( res : Error | any ) => boolean
9+ reportError ?: ( res : Error | any ) => boolean ,
1010) => void
1111
1212// Options for graphql-middleware-sentry
@@ -27,7 +27,7 @@ export const sentry = <Context>({
2727 withScope,
2828 captureReturnedErrors = false ,
2929 forwardErrors = false ,
30- reportError
30+ reportError,
3131} : Options < Context > ) : IMiddlewareFunction => {
3232 // Check if either sentryInstance or config.dsn is present
3333 if ( ! sentryInstance && ! config . dsn ) {
@@ -70,7 +70,7 @@ function captureException<Context>(
7070 withScope : ExceptionScope < Context > ,
7171 reportError ?: ( res ) => boolean ,
7272) {
73- if ( reportError && reportError ( error ) || reportError === undefined ) {
73+ if ( ( reportError && reportError ( error ) ) || reportError === undefined ) {
7474 sentryInstance . withScope ( scope => {
7575 withScope ( scope , error , ctx )
7676 sentryInstance . captureException ( error )
You can’t perform that action at this time.
0 commit comments