mirror of
https://github.com/caprover/caprover
synced 2026-05-29 14:50:55 +00:00
Added logs for NetData failure
This commit is contained in:
+7
-1
@@ -95,6 +95,7 @@ app.use(CaptainConstants.netDataRelativePath, Injector.injectUserUsingCookieData
|
||||
app.use(CaptainConstants.netDataRelativePath, function (req, res, next) {
|
||||
|
||||
if (!res.locals.user) {
|
||||
Logger.e('User not logged in for NetData');
|
||||
res.sendStatus(500);
|
||||
}
|
||||
else {
|
||||
@@ -109,12 +110,17 @@ app.use(CaptainConstants.netDataRelativePath, function (req, res, next) {
|
||||
if (res.locals.errorProxyHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (err) {
|
||||
Logger.e(err);
|
||||
}
|
||||
|
||||
res.locals.errorProxyHandled = true;
|
||||
res.writeHead(500, {
|
||||
'Content-Type': 'text/plain'
|
||||
});
|
||||
|
||||
res.end('Something went wrong...');
|
||||
res.end('Something went wrong... err: \n ' + (err ? err : 'NULL'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user