import app from "@/global.js" import BaseError from "./BaseError.js" export default class ApiError extends BaseError { constructor(message, status = ApiError.ERR_CODE.BAD_REQUEST) { super(message, status) this.name = "ApiError" const ctx = app.currentContext this.ctx = ctx this.user = ctx?.state?.user || null this.info = { path: ctx?.path || "", method: ctx?.method || "", query: ctx?.query || {}, body: ctx?.request?.body || {}, params: ctx?.params || {}, } } }