Browse Source

Merge pull request #1739 from nocodb/fix/simple

chore: typo correction for better error update
pull/1745/head
navi 3 years ago committed by GitHub
parent
commit
0ebb0e75ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/nocodb/src/lib/noco/meta/helpers/catchError.ts

6
packages/nocodb/src/lib/noco/meta/helpers/catchError.ts

@ -8,7 +8,7 @@ export default function(
// todo: error log
console.log(requestHandler.name ? `${requestHandler.name} ::` : '', e);
if (e instanceof BasRequest) {
if (e instanceof BadRequest) {
return res.status(400).json({ msg: e.message });
} else if (e instanceof Unauthorized) {
return res.status(401).json({ msg: e.message });
@ -26,7 +26,7 @@ export default function(
};
}
class BasRequest extends Error {}
class BadRequest extends Error {}
class Unauthorized extends Error {}
class Forbidden extends Error {}
class NotFound extends Error {}
@ -38,7 +38,7 @@ export class NcError {
throw new NotFound(message);
}
static badRequest(message) {
throw new BasRequest(message);
throw new BadRequest(message);
}
static unauthorized(message) {
throw new Unauthorized(message);

Loading…
Cancel
Save