| 1 | import { HttpStatus } from '@nestjs/common'; |
| 2 | import { DomainError } |
| 3 | |
| 4 | export class IssueNotFoundError |
| 5 | status: number |
| 6 | |
| 7 | constructor() { |
| 8 | super('Issue not found'); |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | export class IssueNotOpenError |
| 13 | status: number |
| 14 | |
| 15 | constructor(state: |
| 16 | super(`This issue is ${state |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export class IssueCommentNotFoundError |
| 21 | status: number |
| 22 | |
| 23 | constructor() { |
| 24 | super('Comment not found'); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | export class NotCommentAuthorError |
| 29 | status: number |
| 30 | |
| 31 | constructor() { |
| 32 | super('Only its author can edit a comment'); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export class LabelNotFoundError |
| 37 | status: number |
| 38 | |
| 39 | constructor(name: |
| 40 | super(`Label not found: ${name |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | export class LabelAlreadyExistsError |
| 45 | status: number |
| 46 | |
| 47 | constructor(name: |
| 48 | super(`A label already exists with the name: ${name |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | export class PullRequestReopenError |
| 53 | status: number |
| 54 | |
| 55 | constructor() { |
| 56 | super('A closed pull request cannot be reopened'); |
| 57 | } |
| 58 | } |