// class HttpException extends Error {
//     constructor(message, statusCode = 500) {
//         super(message);
//         this.statusCode = statusCode;
//     }
// }

// module.exports = HttpException;

class HttpException extends Error {
    constructor(message = 'Internal Server Error', statusCode = 500) {
        super(typeof message === 'string' ? message : 'Validation failed');
        this.statusCode = statusCode;
        this.message = message; // bisa object atau string
    }
}

module.exports = HttpException;
