Hugging Face Deployer
Deploy bot to Hugging Face Spaces
03b405b
Raw History Blame Contribute Delete
434 Bytes
class AppError extends Error {
constructor(message, code = "APP_ERROR", details = {}) {
super(message);
this.name = "AppError";
this.code = code;
this.details = details;
}
}
function serializeError(error) {
return {
name: error?.name || "Error",
message: error?.message || String(error),
code: error?.code || "UNKNOWN",
stack: error?.stack
};
}
module.exports = { AppError, serializeError };