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

feat(core): export storage error codes #2555

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion libs/core/src/storage/error/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {
DaffInheritableError,
} from '../../errors/public_api';

export const DAFF_STORAGE_SERVICE_ERROR_CODE = 'DAFF_STORAGE_FAILURE';

export class DaffStorageServiceError extends DaffInheritableError implements DaffError {
public readonly code: string = 'DAFF_STORAGE_FAILURE';
public readonly code: string = DAFF_STORAGE_SERVICE_ERROR_CODE;

constructor(public message: string) {
super(message);
Expand Down
5 changes: 4 additions & 1 deletion libs/core/src/storage/error/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export { DaffStorageServiceError } from './error';
export {
DaffStorageServiceError,
DAFF_STORAGE_SERVICE_ERROR_CODE,
} from './error';
export { DaffErrorStorageService } from './error.service';
5 changes: 4 additions & 1 deletion libs/core/src/storage/server-error/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export { DaffServerSideStorageError } from './server-error';
export {
DaffServerSideStorageError,
DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE,
} from './server-error';
export { DaffServerErrorStorageService } from './server-error.service';
4 changes: 3 additions & 1 deletion libs/core/src/storage/server-error/server-error.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { DaffError } from '../../errors/public_api';
import { DaffStorageServiceError } from '../error/error';

export const DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE = 'DAFF_SERVER_STORAGE_FAILURE';

/**
* An error thrown when there is an attempt to access storage on the server and none is available.
*/
export class DaffServerSideStorageError extends DaffStorageServiceError implements DaffError {
public readonly code: string = 'DAFF_SERVER_STORAGE_FAILURE';
public readonly code: string = DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE;

constructor(public message: string) {
super(message);
Expand Down