| 1 | import { HttpStatus } from '@nestjs/common'; |
| 2 | import { DomainError } |
| 3 | |
| 4 | export class WalCorruptError |
| 5 | status: number |
| 6 | |
| 7 | constructor(detail: |
| 8 | super(`Write-ahead log is corrupt: ${detail |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | export class NonFastForwardError |
| 13 | status: number |
| 14 | |
| 15 | constructor(readonly ref |
| 16 | super( |
| 17 | `Updates were rejected because the remote contains work you do not have locally: ${ref}`, |
| 18 | ); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export class WalContentionError |
| 23 | status: number |
| 24 | |
| 25 | constructor(repoId: |
| 26 | super(`Too many concurrent pushes to ${repoId |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /** The index is a tombstone. Reads as absent, like a repository that never existed. */ |
| 31 | export class RepositoryDeletedError |
| 32 | status: number |
| 33 | |
| 34 | constructor() { |
| 35 | super('Repository not found'); |
| 36 | } |
| 37 | } |