
Security News
PHP Foundation Says Chainguard Broke Security Embargo Ahead of Emergency Patches
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.
@eggjs/onerror
Advanced tools
Default error handling plugin for egg.
onerror plugin is enabled by default in egg. But you still can configure its properties to fits your scenarios.
errorPageUrl: String or Function - If user request html pages in production environment and unexpected error happened, it will redirect user to errorPageUrl.accepts: Function - detect user's request accept json or html.all: Function - customize error handler, if all present, negotiation will be ignored.html: Function - customize html error handler.text: Function - customize text error handler.json: Function - customize json error handler.js: Function - customize JSONP error handler.// config/config.default.ts
import { defineConfig } from 'egg';
export default defineConfig({
onerror: {
// errorPageUrl support function
errorPageUrl: (err, ctx) => ctx.errorPageUrl || '/500',
},
});
// an accept detect function that mark all request with `x-requested-with=XMLHttpRequest` header accepts json.
function accepts(ctx) {
if (ctx.get('x-requested-with') === 'XMLHttpRequest') return 'json';
return 'html';
}
Please open an issue here.
Made with contributors-img.
FAQs
error handler for egg
The npm package @eggjs/onerror receives a total of 457 weekly downloads. As such, @eggjs/onerror popularity was classified as not popular.
We found that @eggjs/onerror demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.

Threat Research
/Security News
A supply chain attack compromised LiteLLM 1.107.0 on PyPI and Docker, spreading malware that steals cloud credentials, developer secrets, and AI provider keys.