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

teableio / teable / 8387093605

22 Mar 2024 07:48AM CUT coverage: 28.027% (-0.2%) from 28.222%
8387093605

Pull #484

github

web-flow
Merge 174ef76f7 into a06c6afb1
Pull Request #484: feat: support increment import

2099 of 3218 branches covered (65.23%)

24 of 703 new or added lines in 18 files covered. (3.41%)

49 existing lines in 6 files now uncovered.

25815 of 92109 relevant lines covered (28.03%)

5.52 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