| 1 | import { HttpStatus } from '@nestjs/common'; |
| 2 | import { DomainError } |
| 3 | |
| 4 | export class ReleaseNotFoundError |
| 5 | status: number |
| 6 | |
| 7 | constructor() { |
| 8 | super('Release not found'); |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | export class ReleaseAlreadyExistsError |
| 13 | status: number |
| 14 | |
| 15 | constructor(tagName: |
| 16 | super(`A release already exists for the tag: ${tagName |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export class InvalidTagNameError |
| 21 | status: number |
| 22 | |
| 23 | constructor(tagName: |
| 24 | super(`Not a valid tag name: ${tagName |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | export class TagTargetNotFoundError |
| 29 | status: number |
| 30 | |
| 31 | constructor(target: |
| 32 | super(`Nothing to tag at: ${target |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | export class ReleaseAssetNotFoundError |
| 37 | status: number |
| 38 | |
| 39 | constructor() { |
| 40 | super('Release asset not found'); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | export class ReleaseAssetExistsError |
| 45 | status: number |
| 46 | |
| 47 | constructor(name: |
| 48 | super(`This release already has an asset named: ${name |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | export class InvalidAssetNameError |
| 53 | status: number |
| 54 | |
| 55 | constructor(name: |
| 56 | super(`Not a valid file name: ${name |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | export class ReleaseAssetTooLargeError |
| 61 | status: number |
| 62 | |
| 63 | constructor(limit: |
| 64 | super(`Release assets are limited to ${limit |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | export class ContentLengthRequiredError |
| 69 | status: number |
| 70 | |
| 71 | constructor() { |
| 72 | super('An upload must declare its Content-Length'); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | export class UploadNotOctetStreamError |
| 77 | status: number |
| 78 | |
| 79 | constructor() { |
| 80 | super( |
| 81 | 'Send the file as application/octet-stream, and its own type as the `type` query parameter', |
| 82 | ); |
| 83 | } |
| 84 | } |