Initial project bootstrap

这个提交包含在:
Manus
2026-03-14 07:18:53 -04:00
当前提交 00d6319ffb
修改 115 个文件,包含 21950 行新增0 行删除

19
shared/_core/errors.ts 普通文件
查看文件

@@ -0,0 +1,19 @@
/**
* Base HTTP error class with status code.
* Throw this from route handlers to send specific HTTP errors.
*/
export class HttpError extends Error {
constructor(
public statusCode: number,
message: string
) {
super(message);
this.name = "HttpError";
}
}
// Convenience constructors
export const BadRequestError = (msg: string) => new HttpError(400, msg);
export const UnauthorizedError = (msg: string) => new HttpError(401, msg);
export const ForbiddenError = (msg: string) => new HttpError(403, msg);
export const NotFoundError = (msg: string) => new HttpError(404, msg);