const { METHODS: httpMethods } = require('http');
const common = require('../common');
-const { DingusError } = require('../errors');
+const { DingusError, RouterNoPathError, RouterNoMethodError } = require('../errors');
const PathParameter = require('./path-parameter');
// Internal identifiers for route entries.
if ('*' in matchedPath[kPathMethods]) {
return matchedPath[kPathMethods]['*'];
}
- throw new DingusError('NoMethod');
+ throw new RouterNoMethodError();
}
ctx.unmatchedPath = pathParts;
- throw new DingusError('NoPath');
+ throw new RouterNoPathError();
}