• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

teableio / teable / 8389034572

22 Mar 2024 10:38AM CUT coverage: 26.087% (-2.1%) from 28.208%
8389034572

Pull #487

github

web-flow
Merge 3045b1f94 into a06c6afb1
Pull Request #487: refactor: move zod schema to openapi

2100 of 3363 branches covered (62.44%)

282 of 757 new or added lines in 74 files covered. (37.25%)

224 existing lines in 8 files now uncovered.

25574 of 98035 relevant lines covered (26.09%)

5.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/nestjs-backend/src/custom.exception.ts
1
import { HttpException, HttpStatus } from '@nestjs/common';
×
2
import { ErrorCodeToStatusMap, HttpErrorCode } from '@teable/core';
×
3

×
4
export class CustomHttpException extends HttpException {
×
5
  code: string;
×
6

×
7
  constructor(message: string, code: HttpErrorCode) {
×
8
    super(message, ErrorCodeToStatusMap[code]);
×
9
    this.code = code;
×
10
  }
×
11
}
×
12

×
13
export const getDefaultCodeByStatus = (status: HttpStatus) => {
×
14
  switch (status) {
×
15
    case HttpStatus.BAD_REQUEST:
×
16
      return HttpErrorCode.VALIDATION_ERROR;
×
17
    case HttpStatus.UNAUTHORIZED:
×
18
      return HttpErrorCode.UNAUTHORIZED;
×
19
    case HttpStatus.FORBIDDEN:
×
20
      return HttpErrorCode.RESTRICTED_RESOURCE;
×
21
    case HttpStatus.NOT_FOUND:
×
22
      return HttpErrorCode.NOT_FOUND;
×
23
    case HttpStatus.INTERNAL_SERVER_ERROR:
×
24
      return HttpErrorCode.INTERNAL_SERVER_ERROR;
×
25
    case HttpStatus.SERVICE_UNAVAILABLE:
×
26
      return HttpErrorCode.DATABASE_CONNECTION_UNAVAILABLE;
×
27
    default:
×
28
      return HttpErrorCode.UNKNOWN_ERROR_CODE;
×
29
  }
×
30
};
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc