Skip to content

Commit

Permalink
feat(core): export storage error codes (#2555)
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Aug 30, 2023
1 parent 9bc2359 commit 24d438f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
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

0 comments on commit 24d438f

Please sign in to comment.