mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-16 16:40:06 +00:00
chore: introduced new error types: InvalidJsonError, JsonParseArrayError, WeboutResponseError
This commit is contained in:
7
src/types/errors/InvalidJsonError.ts
Normal file
7
src/types/errors/InvalidJsonError.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export class InvalidJsonError extends Error {
|
||||||
|
constructor() {
|
||||||
|
super('Error: invalid Json string')
|
||||||
|
this.name = 'InvalidJsonError'
|
||||||
|
Object.setPrototypeOf(this, InvalidJsonError.prototype)
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/types/errors/JsonParseArrayError.ts
Normal file
7
src/types/errors/JsonParseArrayError.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export class JsonParseArrayError extends Error {
|
||||||
|
constructor(public message: string) {
|
||||||
|
super(message)
|
||||||
|
this.name = 'JsonParseArrayError'
|
||||||
|
Object.setPrototypeOf(this, JsonParseArrayError.prototype)
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/types/errors/WeboutResponseError.ts
Normal file
7
src/types/errors/WeboutResponseError.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export class WeboutResponseError extends Error {
|
||||||
|
constructor(public url: string) {
|
||||||
|
super(`Error: error while parsing response from ${url}`)
|
||||||
|
this.name = 'WeboutResponseError'
|
||||||
|
Object.setPrototypeOf(this, WeboutResponseError.prototype)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,3 +8,6 @@ export * from './NotFoundError'
|
|||||||
export * from './ErrorResponse'
|
export * from './ErrorResponse'
|
||||||
export * from './NoSessionStateError'
|
export * from './NoSessionStateError'
|
||||||
export * from './RootFolderNotFoundError'
|
export * from './RootFolderNotFoundError'
|
||||||
|
export * from './JsonParseArrayError'
|
||||||
|
export * from './WeboutResponseError'
|
||||||
|
export * from './InvalidJsonError'
|
||||||
|
|||||||
Reference in New Issue
Block a user