- point MySQL and Whisper settings to the VM - add VM MySQL bootstrap scripts and docs - allow LAN Vite origins for CORS - fix Express 5 validation assignment crash - allow login with username or email - prevent recursive auth refresh retries
17 lines
407 B
JavaScript
17 lines
407 B
JavaScript
export class AppError extends Error {
|
|
constructor(message, status = 500, code = "INTERNAL_ERROR", details = null) {
|
|
super(message);
|
|
this.name = "AppError";
|
|
this.status = status;
|
|
this.code = code;
|
|
this.details = details;
|
|
}
|
|
}
|
|
|
|
export function assertFound(value, message = "Resource not found") {
|
|
if (!value) {
|
|
throw new AppError(message, 404, "NOT_FOUND");
|
|
}
|
|
return value;
|
|
}
|