url error log
This commit is contained in:
parent
328875d0f5
commit
ba21ae60d7
2 changed files with 15 additions and 2 deletions
|
@ -57,7 +57,14 @@ export default async function genericProxyHandler(req, res, map) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status >= 400) {
|
if (status >= 400) {
|
||||||
logger.debug("HTTP Error %d calling %s//%s%s%s...", status, url.protocol, url.hostname, url.port, url.pathname);
|
logger.debug(
|
||||||
|
"HTTP Error %d calling %s//%s:%s%s...",
|
||||||
|
status,
|
||||||
|
url.protocol,
|
||||||
|
url.hostname,
|
||||||
|
url.port,
|
||||||
|
url.pathname
|
||||||
|
);
|
||||||
return res.status(status).json({error: {message: "HTTP Error", url: sanitizeErrorURL(url), resultData}});
|
return res.status(status).json({error: {message: "HTTP Error", url: sanitizeErrorURL(url), resultData}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,13 @@ export async function httpProxy(url, params = {}) {
|
||||||
return [status, contentType, data, responseHeaders];
|
return [status, contentType, data, responseHeaders];
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
logger.error("Error calling %s//%s:%s%s...", constructedUrl.protocol, constructedUrl.hostname, constructedUrl.port, constructedUrl.pathname);
|
logger.error(
|
||||||
|
"Error calling %s//%s:%s%s...",
|
||||||
|
constructedUrl.protocol,
|
||||||
|
constructedUrl.hostname,
|
||||||
|
constructedUrl.port,
|
||||||
|
constructedUrl.pathname
|
||||||
|
);
|
||||||
logger.error(err);
|
logger.error(err);
|
||||||
return [500, "application/json", { error: {message: err?.message ?? "Unknown error", url, rawError: err} }, null];
|
return [500, "application/json", { error: {message: err?.message ?? "Unknown error", url, rawError: err} }, null];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue