I am totally new to NodeJS(using Loopback framework) and need some help implementing error handlers.
I tried defining strong-error-handler as given in loopback documentation like:
app.bind(RestBindings.ERROR_WRITER_OPTIONS).to({debug: true});
And got the below error:
error TS2769: No overload matches this call.
Overload 1 of 2, '(keyWithPath: BindingAddress<unknown>, session?: ResolutionSession | undefined): Promise<unknown>', gave the following error.
Argument of type '(req: any, res: any) => any' is not assignable to parameter of type 'ResolutionSession'.
Type '(req: any, res: any) => any' is missing the following properties from type 'ResolutionSession': stack, pushInjection, popInjection, currentInjection, and 8 more.
Overload 2 of 2, '(keyWithPath: BindingAddress<unknown>, options: ResolutionOptions): Promise<unknown>', gave the following error.
Value of type '(req: any, res: any) => any' has no properties in common with type 'ResolutionOptions'. Did you mean to call it?
Can someone please help me in resolving this?
Also an example to illustrate globalized error handling in nodejs using loopback would be of great help.