From 3439437c18055cf87557de5f8b8b0e09107af9c1 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 22 Aug 2013 18:47:07 -0700 Subject: [PATCH] add app.error(fn). Closes #4 --- lib/application.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/application.js b/lib/application.js index 0f0f3c7..cda045c 100644 --- a/lib/application.js +++ b/lib/application.js @@ -139,6 +139,17 @@ app.callback = function(){ } }; +/** + * Set the application-level error handling `fn`. + * + * @param {Function} fn + * @api public + */ + +app.error = function(fn){ + this.onerror = fn; +}; + /** * Default error handler. *