Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore code property #320

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 40 additions & 8 deletions packages/interface-store/src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,87 @@
export class OpenFailedError extends Error {
static name = 'OpenFailedError'
static code = 'ERR_OPEN_FAILED'
name = OpenFailedError.name
code = OpenFailedError.code

constructor (message = 'Open failed') {
super(message)
this.name = 'OpenFailedError'
}
}

export class CloseFailedError extends Error {
static name = 'CloseFailedError'
static code = 'ERR_CLOSE_FAILED'
name = CloseFailedError.name
code = CloseFailedError.code

constructor (message = 'Close failed') {
super(message)
this.name = 'CloseFailedError'
}
}

export class PutFailedError extends Error {
static name = 'PutFailedError'
static code = 'ERR_PUT_FAILED'
name = PutFailedError.name
code = PutFailedError.code

constructor (message = 'Put failed') {
super(message)
this.name = 'PutFailedError'
}
}

export class GetFailedError extends Error {
static name = 'GetFailedError'
static code = 'ERR_GET_FAILED'
name = GetFailedError.name
code = GetFailedError.code

constructor (message = 'Get failed') {
super(message)
this.name = 'GetFailedError'
}
}

export class DeleteFailedError extends Error {
static name = 'DeleteFailedError'
static code = 'ERR_DELETE_FAILED'
name = DeleteFailedError.name
code = DeleteFailedError.code

constructor (message = 'Delete failed') {
super(message)
this.name = 'DeleteFailedError'
}
}

export class HasFailedError extends Error {
static name = 'HasFailedError'
static code = 'ERR_HAS_FAILED'
name = HasFailedError.name
code = HasFailedError.code

constructor (message = 'Has failed') {
super(message)
this.name = 'HasFailedError'
}
}

export class NotFoundError extends Error {
static name = 'NotFoundError'
static code = 'ERR_NOT_FOUND'
name = NotFoundError.name
code = NotFoundError.code

constructor (message = 'Not Found') {
super(message)
this.name = 'NotFoundError'
}
}

export class AbortError extends Error {
static name = 'AbortError'
static code = 'ERR_ABORTED'
name = AbortError.name
code = AbortError.code

constructor (message = 'Aborted') {
super(message)
this.name = 'AbortError'
}
}
Loading