-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
145 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
|
||
name: Exceptions Publish | ||
name: CD Exceptions | ||
|
||
on: | ||
push: | ||
|
@@ -12,15 +11,29 @@ jobs: | |
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '13.x' | ||
registry-url: 'https://npm.pkg.github.com' | ||
- run: yarn | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- run: yarn publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
name: Deploy | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Download dependencies | ||
run: npm install | ||
|
||
- name: Transpile typescript to javascript | ||
run: npm run build | ||
|
||
- name: Automatic GitHub Release | ||
uses: justincy/[email protected] | ||
id: release | ||
|
||
- name: Publish to NPM Registry | ||
run: yarn publish --access public | ||
if: steps.release.outputs.released == 'true' | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
name: Deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI Exceptions | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-18.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Download dependencies | ||
run: npm install | ||
|
||
- name: Verify project lint and try to fix it | ||
run: npm run lint:fix | ||
|
||
- name: Run the tests from project | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class BadRequestException extends BaseException { | ||
constructor(content: string | object = 'Bad Request Error', code = 400) { | ||
super(BadRequestException.name, content, code); | ||
constructor(content: string | any = 'Bad Request Error', code = 400) { | ||
super(BadRequestException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class ForbiddenException extends BaseException { | ||
constructor(content: string | object = 'Forbidden Error', code = 403) { | ||
super(ForbiddenException.name, content, code); | ||
constructor(content: string | any = 'Forbidden Error', code = 403) { | ||
super(ForbiddenException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class InternalServerException extends BaseException { | ||
constructor(content: string | object = 'Internal Server Error', code = 500) { | ||
super(InternalServerException.name, content, code); | ||
constructor(content: string | any = 'Internal Server Error', code = 500) { | ||
super(InternalServerException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class InvalidMethodException extends BaseException { | ||
constructor(content: string | object = 'Invalid Method Error', code = 405) { | ||
super(InvalidMethodException.name, content, code); | ||
constructor(content: string | any = 'Invalid Method Error', code = 405) { | ||
super(InvalidMethodException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class NotFoundException extends BaseException { | ||
constructor(content: string | object = 'Not Found Error', code = 404) { | ||
super(NotFoundException.name, content, code); | ||
constructor(content: string | any = 'Not Found Error', code = 404) { | ||
super(NotFoundException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class NotImplementedException extends BaseException { | ||
constructor(content: string | object = 'Not Implemented Error', code = 501) { | ||
super(NotImplementedException.name, content, code); | ||
constructor(content: string | any = 'Not Implemented Error', code = 501) { | ||
super(NotImplementedException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class UnauthorizedException extends BaseException { | ||
constructor(content: string | object = 'Unauthorized Error', code = 401) { | ||
super(UnauthorizedException.name, content, code); | ||
constructor(content: string | any = 'Unauthorized Error', code = 401) { | ||
super(UnauthorizedException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class UnprocessableEntityException extends BaseException { | ||
constructor(content: string | object = 'Unprocessable Entity Error', code = 403) { | ||
super(UnprocessableEntityException.name, content, code); | ||
constructor( | ||
content: string | any = 'Unprocessable Entity Error', | ||
code = 403, | ||
) { | ||
super(UnprocessableEntityException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from "../BaseException"; | ||
import { BaseException } from '../BaseException' | ||
|
||
export class UnsupportedMediaException extends BaseException { | ||
constructor(content: string | object = 'Unsupported Media Error', code = 403) { | ||
super(UnsupportedMediaException.name, content, code); | ||
constructor(content: string | any = 'Unsupported Media Error', code = 403) { | ||
super(UnsupportedMediaException.name, content, code) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters