| 1 | import { HttpStatus } from '@nestjs/common'; |
| 2 | import { DomainError } |
| 3 | |
| 4 | export class InvalidBranchNameError |
| 5 | status: number |
| 6 | |
| 7 | constructor(name: |
| 8 | super(`Not a valid branch name: ${name |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | export class BranchAlreadyExistsError |
| 13 | status: number |
| 14 | |
| 15 | constructor(name: |
| 16 | super(`A branch already exists with the name: ${name |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export class BranchSourceNotFoundError |
| 21 | status: number |
| 22 | |
| 23 | constructor(source: |
| 24 | super(`Nothing to branch from at: ${source |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | export class DefaultBranchDeletionError |
| 29 | status: number |
| 30 | |
| 31 | constructor(name: |
| 32 | super( |
| 33 | `The default branch cannot be deleted: ${name}. Pick another default branch in the settings first.` |
| 34 | ); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | export class BranchInUseError |
| 39 | status: number |
| 40 | |
| 41 | constructor(name: |
| 42 | super( |
| 43 | `The branch ${name} is used by open pull request #${ |
| 44 | ); |
| 45 | } |
| 46 | } |