| 1 | import { HttpStatus } from '@nestjs/common'; |
| 2 | |
| 3 | import { DomainError } |
| 4 | import { formatByteSize } |
| 5 | |
| 6 | export class LfsObjectNotFoundError |
| 7 | status: number |
| 8 | |
| 9 | constructor() { |
| 10 | super('LFS object not found'); |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | export class InvalidLfsOidError |
| 15 | status: number |
| 16 | |
| 17 | constructor(oid: |
| 18 | super(`${oid} |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export class LfsObjectTooLargeError |
| 23 | status: number |
| 24 | |
| 25 | constructor(limit: |
| 26 | super(`An LFS object can be at most ${formatByteSize |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | export class LfsUploadInProgressError |
| 31 | status: number |
| 32 | |
| 33 | constructor(oid: |
| 34 | super(`Another upload of ${oid |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | export class LfsObjectMismatchError |
| 39 | status: number |
| 40 | |
| 41 | constructor(oid: |
| 42 | super(`The uploaded bytes hash to ${actual |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | export class LfsLockNotFoundError |
| 47 | status: number |
| 48 | |
| 49 | constructor() { |
| 50 | super('Lock not found'); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | export class LfsLockForbiddenError |
| 55 | status: number |
| 56 | |
| 57 | constructor() { |
| 58 | super('Only the lock owner can unlock it, or an admin with force'); |
| 59 | } |
| 60 | } |