import { translations } from '@payloadcms/translations/api';
import httpStatus from 'http-status';
import APIError from './APIError.js';
class ValidationError extends APIError {
    constructor(results, t){
        const message = t ? t('error:followingFieldsInvalid', {
            count: results.length
        }) : results.length === 1 ? translations.en.error.followingFieldsInvalid_one : translations.en.error.followingFieldsInvalid_other;
        super(`${message} ${results.map((f)=>f.field).join(', ')}`, httpStatus.BAD_REQUEST, results);
    }
}
export default ValidationError;

//# sourceMappingURL=ValidationError.js.map