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

opengovsg / FormSG / 10879423892

16 Sep 2024 07:56AM CUT coverage: 73.849% (+0.4%) from 73.483%
10879423892

push

github

Ken
chore: remove credits-generator, should use npx instead

2355 of 3955 branches covered (59.54%)

Branch coverage included in aggregate %.

9582 of 12209 relevant lines covered (78.48%)

54.98 hits per line

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

51.43
/src/app/modules/form/admin-form/admin-form.errors.ts
1
import {
52✔
2
  GO_ALREADY_EXIST_ERROR_MESSAGE,
3
  GO_VALIDATION_ERROR_MESSAGE,
4
} from '../../../../../shared/constants'
5
import { ApplicationError, ErrorCodes } from '../../core/core.errors'
52✔
6

7
export class InvalidFileTypeError extends ApplicationError {
52✔
8
  constructor(message = 'Unsupported file type') {
×
9
    super(message, undefined, ErrorCodes.ADMIN_FORM_INVALID_FILE_TYPE)
6✔
10
  }
11
}
12

13
export class EditFieldError extends ApplicationError {
52✔
14
  constructor(message: string) {
15
    super(message, undefined, ErrorCodes.ADMIN_FORM_EDIT_FIELD)
7✔
16
  }
17
}
18

19
export class FieldNotFoundError extends ApplicationError {
52✔
20
  constructor(message = 'Field to modify not found') {
10✔
21
    super(message, undefined, ErrorCodes.ADMIN_FORM_FIELD_NOT_FOUND)
15✔
22
  }
23
}
24

25
export class InvalidCollaboratorError extends ApplicationError {
52✔
26
  constructor(message: string) {
27
    super(message, undefined, ErrorCodes.ADMIN_FORM_INVALID_COLLABORATOR)
1✔
28
  }
29
}
30

31
export class PaymentChannelNotFoundError extends ApplicationError {
52✔
32
  constructor(
33
    message = 'Please ensure that you have connected your Stripe account in settings to save this field',
×
34
  ) {
35
    super(message, undefined, ErrorCodes.ADMIN_FORM_PAYMENT_CHANNEL_NOT_FOUND)
×
36
  }
37
}
38

39
// Family of GoGov Errors from GoGov Integration
40
export class GoGovError extends ApplicationError {
52✔
41
  constructor(
42
    message = 'Error occurred when claiming GoGov link',
×
43
    errorCode?: ErrorCodes,
44
  ) {
45
    super(message, undefined, errorCode || ErrorCodes.ADMIN_FORM_GOGOV)
×
46
  }
47
}
48

49
export class GoGovValidationError extends GoGovError {
52✔
50
  constructor(message = GO_VALIDATION_ERROR_MESSAGE) {
×
51
    super(message, ErrorCodes.ADMIN_FORM_GOGOV_VALIDATION)
×
52
  }
53
}
54

55
export class GoGovAlreadyExistError extends GoGovError {
52✔
56
  constructor(message = GO_ALREADY_EXIST_ERROR_MESSAGE) {
×
57
    super(message, ErrorCodes.ADMIN_FORM_GOGOV_ALREADY_EXIST)
×
58
  }
59
}
60

61
export class GoGovRequestLimitError extends GoGovError {
52✔
62
  constructor(message = 'GoGov request limit exceeded') {
×
63
    super(message, ErrorCodes.ADMIN_FORM_GOGOV_REQUEST_LIMIT)
×
64
  }
65
}
66

67
export class GoGovBadGatewayError extends GoGovError {
52✔
68
  constructor(message = 'GoGov request failed') {
×
69
    super(message, ErrorCodes.ADMIN_FORM_GOGOV_BAD_GATEWAY)
×
70
  }
71
}
72

73
export class GoGovServerError extends GoGovError {
52✔
74
  // Default error message will be shown if not AxiosError
75
  constructor(message = 'Unexpected error occured when claiming GoGov link') {
×
76
    super(message, ErrorCodes.ADMIN_FORM_GOGOV_SERVER)
×
77
  }
78
}
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