Innovenergy_trunk/frontend/node_modules/testcafe-hammerhead/lib/messages.js

27 lines
2.8 KiB
JavaScript
Raw Normal View History

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getText = exports.MESSAGE = void 0;
exports.MESSAGE = {
destConnectionTerminated: 'Failed to perform a request to the resource at <a href="{url}">{url}</a> because of an error.\n{message}',
cantResolveUrl: 'Failed to find a DNS-record for the resource at <a href="{url}">{url}</a>.',
cantEstablishTunnelingConnection: 'Cannot establish a tunnel to <a href="{url}">{url}</a>. The proxy may be unresponsive or unable to handle HTTPS connections.',
cantEstablishProxyConnection: 'Failed to connect to the proxy host at <a href="{url}">{url}</a>.',
cantAuthorizeToProxy: 'Failed to authorize to the proxy at <a href="{url}">{url}</a>.',
destRequestTimeout: 'Failed to complete a request to <a href="{url}">{url}</a> within the timeout period. The problem may be related to local machine\'s network or firewall settings, server outage, or network problems that make the server inaccessible.',
cantReadFile: 'Failed to read a file at <a href="{url}">{url}</a> because of the error:\n\n{message}',
nodeError: {
'HPE_HEADER_OVERFLOW': 'The request header\'s size is {headerSize} bytes which exceeds the set limit.\nIt causes an internal Node.js error on parsing this header.\nTo fix the problem, you need to add the \'--max-http-header-size=...\' flag to the \'NODE_OPTIONS\' environment variable:\n\nmacOS, Linux (bash, zsh)\nexport NODE_OPTIONS=\'--max-http-header-size={recommendedMaxHeaderSize}\'\n\nWindows (powershell)\n$env:NODE_OPTIONS=\'--max-http-header-size={recommendedMaxHeaderSize}\'\n\nWindows (cmd)\nset NODE_OPTIONS="--max-http-header-size={recommendedMaxHeaderSize}"\n\nand then start your tests.',
'HPE_INVALID_HEADER_TOKEN': 'The request contains a header that doesn\'t comply with the specification <a href="https://tools.ietf.org/html/rfc7230#section-3.2.4">https://tools.ietf.org/html/rfc7230#section-3.2.4</a>.\nIt causes an internal Node.js error on parsing this header.\n\nInvalid characters:\n{invalidChars}\n\nTo fix the problem, you can add the \'--insecure-http-parser\' flag to the \'NODE_OPTIONS\' environment variable:\n\nmacOS, Linux (bash, zsh)\nexport NODE_OPTIONS=\'--insecure-http-parser\'\n\nWindows (powershell)\n$env:NODE_OPTIONS=\'--insecure-http-parser\'\n\nWindows (cmd)\nset NODE_OPTIONS="--insecure-http-parser"\n\nand then start your tests.',
},
invalidHeaderCharacter: 'Character with code "{charCode}" in header "{name}" {location} at index {index}',
};
function getText(template, parameters) {
let errorStr = template;
for (const [parameterName, parameterValue] of Object.entries(parameters)) {
if (parameterValue)
errorStr = errorStr.replace(new RegExp(`{${parameterName}}`, 'g'), parameterValue);
}
return errorStr;
}
exports.getText = getText;