ML-Learner / Backend_node /src /utils /ApiError.ts
VashuTheGreat2's picture
Upload folder using huggingface_hub
c01955c verified
class ApiError extends Error {
public statusCode: number;
public success: boolean;
constructor(status: number, message = "something went wrong") {
super(message);
this.statusCode = status;
this.message = message;
this.success = false;
// Ensure the prototype is correctly set for built-in Error extension
Object.setPrototypeOf(this, ApiError.prototype);
}
}
export default ApiError;