12 lines
363 B
TypeScript
12 lines
363 B
TypeScript
export type ActionResult<T = void> =
|
|
| { success: true; data: T }
|
|
| { success: false; error: string; fieldErrors?: Record<string, string[]> };
|
|
|
|
|
|
export class AppError extends Error {
|
|
fieldErrors?: Record<string, string[]>;
|
|
constructor(message: string, fieldErrors?: Record<string, string[]>) {
|
|
super(message);
|
|
this.fieldErrors = fieldErrors;
|
|
}
|
|
} |