project setup with core files including configuration, package management, and basic structure. Added .gitignore, README, and various TypeScript types for CMS components. Implemented initial components and layouts for the application.
This commit is contained in:
28
middlelayer/utils/errors.ts
Normal file
28
middlelayer/utils/errors.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Custom Error-Klassen für den Middlelayer
|
||||
*/
|
||||
export class DataServiceError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly code: string,
|
||||
public readonly originalError?: unknown
|
||||
) {
|
||||
super(message);
|
||||
this.name = 'DataServiceError';
|
||||
}
|
||||
}
|
||||
|
||||
export class AdapterError extends DataServiceError {
|
||||
constructor(message: string, originalError?: unknown) {
|
||||
super(message, 'ADAPTER_ERROR', originalError);
|
||||
this.name = 'AdapterError';
|
||||
}
|
||||
}
|
||||
|
||||
export class NotFoundError extends DataServiceError {
|
||||
constructor(resource: string, identifier: string) {
|
||||
super(`${resource} mit ID '${identifier}' nicht gefunden`, 'NOT_FOUND');
|
||||
this.name = 'NotFoundError';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user