const { ERROR_MESSAGES } = require('../constants/Messages');

class HandledError extends Error {
    constructor(baseError) {
        super(baseError.message)
        const { code } = baseError;

        this.message = ERROR_MESSAGES[code];
    }
}

module.exports = HandledError;
