Closed colorcube closed 1 year ago
I guess this is the code to be changed:
if (error instanceof HttpAccessDeniedError) {
event.next('accessDenied', new HttpAccessDeniedEvent(event.injectorContext, event.request, event.response, event.route));
} else {
const errorEvent = new HttpControllerErrorEvent(event.injectorContext, event.request, event.response, event.route, error);
errorEvent.controllerActionTime = Date.now() - start;
event.next('controllerError', errorEvent);
}
adding error to HttpAccessDeniedEvent ?!
adding error to HttpAccessDeniedEvent ?!
yes, we can do that
@colorcube added in https://github.com/deepkit/deepkit-framework/commit/53ffb33d5e775067dac34a9146c901d3cbd13acd. Please test and let me know. Thanks
It works for me. Thanks
Sending custom error messages seems not to be easy:
event.error.message is not available there - at least I haven't found the exception message
That means in http controller it's not possible to send custom messages like
in controller something like that is possible get the message out but that's not very sexy