chore(release): public-release readiness fixes for 1.1.16
- Fix MIT LICENSE copyright placeholder - Remove private flag and correct GitHub repository URL in package.json - Bump version to 1.1.16 - Genericize committed config defaults (example.com/localhost) - Harden global error handler against information leakage - Generate random initial password for proxyadmin2 bootstrap account - Correct docs to describe CONF_SECRETS instead of symlink behavior Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+12
-6
@@ -100,15 +100,21 @@ app.use(async function(req, res, next) {
|
||||
|
||||
// Error handler. This is where `next()` will go on error
|
||||
app.use(async function(err, req, res, next) {
|
||||
try{
|
||||
console.error(err.status || res.status, err.name, req.method, req.url);
|
||||
try{
|
||||
const status = err.status || 500;
|
||||
console.error(status, err.name, req.method, req.url);
|
||||
console.error(err.message);
|
||||
console.error(err.stack);
|
||||
if (err.stack) console.error(err.stack);
|
||||
console.error('=========================================');
|
||||
|
||||
res.status(err.status || 500);
|
||||
res.json({name: err.name, message: err.message, keys: err.keys});
|
||||
res.status(status);
|
||||
// Only expose safe, non-internal fields to the client.
|
||||
const body = { name: err.name, message: err.message };
|
||||
res.json(body);
|
||||
}catch(error){
|
||||
console.log('error in the catch all error fn....', error);
|
||||
console.error('error in the catch-all error handler', error);
|
||||
if (!res.headersSent) {
|
||||
res.status(500).json({ name: 'Error', message: 'Internal server error' });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user