| 1 | import { HttpStatus } from '@nestjs/common'; |
| 2 | |
| 3 | import { DomainError } |
| 4 | |
| 5 | export class InvalidGpgKeyError |
| 6 | status: number |
| 7 | |
| 8 | constructor(detail: |
| 9 | super(`That is not a usable public key: ${detail |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | export class GpgKeyAlreadyExistsError |
| 14 | status: number |
| 15 | |
| 16 | constructor() { |
| 17 | super('That key is already on an account'); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export class GpgKeyNotFoundError |
| 22 | status: number |
| 23 | |
| 24 | constructor() { |
| 25 | super('Key not found on this account'); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | export class GpgKeyEmailNotVerifiedError |
| 30 | status: number |
| 31 | |
| 32 | constructor(emails: |
| 33 | super( |
| 34 | emails.length === 0 |
| 35 | ? 'The key carries no email address, so it cannot be matched to your commits' |
| 36 | : `Verify one of the key's addresses on this account first: ${emails. |
| 37 | ); |
| 38 | } |
| 39 | } |