- if (e instanceof DingusError) {
- switch (e.message) {
- case 'NoPath':
- handler = this.handlerNotFound.bind(this);
- break;
- case 'NoMethod':
- handler = this.handlerMethodNotAllowed.bind(this);
- break;
- default:
- this.logger.error(_scope, 'unknown dingus error', { error: e });
- handler = this.handlerInternalServerError.bind(this);
- }
+ if (e instanceof RouterNoPathError) {
+ handler = this.handlerNotFound.bind(this);
+ } else if (e instanceof RouterNoMethodError) {
+ handler = this.handlerMethodNotAllowed.bind(this);
+ } else if (e instanceof DingusError) {
+ this.logger.error(_scope, 'unknown dingus error', { error: e });
+ handler = this.handlerInternalServerError.bind(this);