11import * as crypto from 'node:crypto' ;
22
3- import Debug from 'debug' ;
3+ import debug from 'debug' ;
44
55import instance from '../helpers/weak_cache.js' ;
66import * as formHtml from '../helpers/user_code_form.js' ;
77import { ReRenderError } from '../helpers/re_render_errors.js' ;
88import errOut from '../helpers/err_out.js' ;
99
10- const debug = new Debug ( 'oidc-provider:error' ) ;
11- const serverError = new Debug ( 'oidc-provider:server_error' ) ;
12- const serverErrorTrace = new Debug ( 'oidc-provider:server_error:trace' ) ;
10+ const debugError = debug ( 'oidc-provider:error' ) ;
11+ const serverError = debug ( 'oidc-provider:server_error' ) ;
12+ const serverErrorTrace = debug ( 'oidc-provider:server_error:trace' ) ;
1313
1414const userInputRoutes = new Set ( [ 'code_verification' , 'device_resume' ] ) ;
1515
@@ -26,7 +26,7 @@ export default function getErrorHandler(provider, eventName) {
2626 ctx . status = err . statusCode || 500 ;
2727
2828 if ( err . expose && ! ( err instanceof ReRenderError ) ) {
29- debug ( 'path=%s method=%s error=%o detail=%s' , ctx . path , ctx . method , out , err . error_detail ) ;
29+ debugError ( 'path=%s method=%s error=%o detail=%s' , ctx . path , ctx . method , out , err . error_detail ) ;
3030 } else if ( ! ( err instanceof ReRenderError ) ) {
3131 serverError ( 'path=%s method=%s error=%o' , ctx . path , ctx . method , err ) ;
3232 serverErrorTrace ( err ) ;
0 commit comments