| 1 | import { HttpStatus } from '@nestjs/common'; |
| 2 | import { DomainError } |
| 3 | |
| 4 | export class PullRequestNotFoundError |
| 5 | status: number |
| 6 | |
| 7 | constructor() { |
| 8 | super('Pull request not found'); |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | export class PullRequestAlreadyOpenError |
| 13 | status: number |
| 14 | |
| 15 | constructor(number: |
| 16 | super(`These branches already have an open pull request: #${number |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export class SameBranchPullRequestError |
| 21 | status: number |
| 22 | |
| 23 | constructor() { |
| 24 | super('A pull request cannot merge a branch into itself'); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | export class UnrelatedHistoriesError |
| 29 | status: number |
| 30 | |
| 31 | constructor() { |
| 32 | super('These branches share no common history'); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export class PullRequestNotOpenError |
| 37 | status: number |
| 38 | |
| 39 | constructor(state: |
| 40 | super(`This pull request is ${state |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | export class PullRequestConflictError |
| 45 | status: number |
| 46 | |
| 47 | constructor() { |
| 48 | super('This pull request has conflicts that must be resolved locally'); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | export class NothingToMergeError |
| 53 | status: number |
| 54 | |
| 55 | constructor() { |
| 56 | super('The base branch already contains every commit from the head branch'); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export class UnrelatedRepositoriesError |
| 61 | status: number |
| 62 | |
| 63 | constructor() { |
| 64 | super( |
| 65 | 'A pull request must come from the repository itself or a fork of it', |
| 66 | ); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** A closed request whose head repository was deleted: its commits went with it. */ |
| 71 | export class PullRequestHeadDeletedError |
| 72 | status: number |
| 73 | |
| 74 | constructor() { |
| 75 | super( |
| 76 | 'The repository this pull request came from was deleted, and its changes with it', |
| 77 | ); |
| 78 | } |
| 79 | } |