File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,9 @@ export default function expressGraphQLRateLimiter(
136136 const requestTimestamp = new Date ( ) . valueOf ( ) ;
137137 const { query, variables } : { query : string ; variables : any } = req . body ;
138138 if ( ! query ) {
139- // FIXME: Throw an error here? Code currently passes this on to whatever is next
140- console . log ( 'There is no query on the request' ) ;
139+ console . error (
140+ 'Error in expressGraphQLRateLimiter: There is no query on the request. Rate-Limiting skipped'
141+ ) ;
141142 return next ( ) ;
142143 }
143144 // check for a proxied ip address before using the ip address on request
@@ -189,7 +190,10 @@ export default function expressGraphQLRateLimiter(
189190 }
190191 return next ( ) ;
191192 } catch ( err ) {
192- // todo: refactor error handling
193+ // log the error to the console and pass the request onto the next middleware.
194+ console . error (
195+ `Error in expressGraphQLRateLimiter processing query. Rate limiting is skipped: ${ err } `
196+ ) ;
193197 return next ( err ) ;
194198 }
195199 } ;
You can’t perform that action at this time.
0 commit comments