Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
1004: 'Host Not Configured to Serve Web Traffic',
1005: 'Access Denied: IP of banned ASN/ISP',
1010: 'The owner of this website has banned your access based on your browser\'s signature',
1011: 'Access Denied (Hotlinking Denied)',
1012: 'Access Denied',
1013: 'HTTP hostname and TLS SNI hostname mismatch',
1016: 'Origin DNS error',
1018: 'Domain is misconfigured',
1020: 'Access Denied (Custom Firewall Rules)'
};
ERROR_CODES[1006] =
ERROR_CODES[1007] =
ERROR_CODES[1008] = 'Access Denied: Your IP address has been banned';
const OriginalError = original.RequestError;
const RequestError = create('RequestError', 0);
const CaptchaError = create('CaptchaError', 1);
// errorType 4 is a CloudflareError so this constructor is reused.
const CloudflareError = create('CloudflareError', 2, function (error) {
if (!isNaN(error.cause)) {
const description = ERROR_CODES[error.cause] || http.STATUS_CODES[error.cause];
if (description) {
error.message = error.cause + ', ' + description;
}
}
});
const ParserError = create('ParserError', 3, function (error) {
error.message = BUG_REPORT + error.message;