X-Git-Url: http://git.squeep.com/?p=squeep-api-dingus;a=blobdiff_plain;f=lib%2Frouter%2Findex.js;fp=lib%2Frouter%2Findex.js;h=fd19bdf5192cfd9efd7b4c00023f1ae92265cbd1;hp=1585065e14ce79b804cd6de967965951ab0d535a;hb=031c170bdaf1d9c331e6f6fc701ce6540c0e6941;hpb=df1c89ca311a06417104e6be0ade6617cbfae60e diff --git a/lib/router/index.js b/lib/router/index.js index 1585065..fd19bdf 100644 --- a/lib/router/index.js +++ b/lib/router/index.js @@ -7,7 +7,7 @@ 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. @@ -266,10 +266,10 @@ class Router { if ('*' in matchedPath[kPathMethods]) { return matchedPath[kPathMethods]['*']; } - throw new DingusError('NoMethod'); + throw new RouterNoMethodError(); } ctx.unmatchedPath = pathParts; - throw new DingusError('NoPath'); + throw new RouterNoPathError(); }