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

teableio / teable / 8388153768

22 Mar 2024 09:25AM CUT coverage: 28.048% (-0.2%) from 28.208%
8388153768

Pull #484

github

web-flow
Merge 27e748d45 into a06c6afb1
Pull Request #484: feat: support increment import

2099 of 3215 branches covered (65.29%)

24 of 738 new or added lines in 21 files covered. (3.25%)

4 existing lines in 3 files now uncovered.

25814 of 92035 relevant lines covered (28.05%)

5.53 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