Skip to content
Browse files

_handleException renamed to handleError()

  • Loading branch information...
1 parent da9ba67 commit 3c11da832e34f841a022a3ee3c0d468e98dea1f3 @akaspin committed May 23, 2010
Showing with 14 additions and 14 deletions.
  1. +14 −14 index.js
View
28 index.js
@@ -190,27 +190,15 @@ Handler.prototype.execute = function() {
this[this.request.method].apply(this, this.args);
} catch (e) {
- this._handleException(e);
+ this.handleError(e);
}
};
/**
- * Just resets all to initial states.
- */
-Handler.prototype.clear = function() {
- this._headers = {
- "Server": "node.js:" + process.version,
- "Content-Type": "text/html; charset=UTF-8",
- };
- this._statusCode = 200;
- this._encoding = 'utf8';
-};
-
-/**
* Handles all exceptions in request. Logs it and send to client if possible.
* @param e Exception
*/
-Handler.prototype._handleException = function(e) {
+Handler.prototype.handleError = function(e) {
if (e instanceof HttpError) {
if (e.code in http.STATUS_CODES) {
sys.error(this._summary() + " " + e);
@@ -231,6 +219,18 @@ Handler.prototype._summary = function() {
}
/**
+ * Just resets all to initial states.
+ */
+Handler.prototype.clear = function() {
+ this._headers = {
+ "Server": "node.js:" + process.version,
+ "Content-Type": "text/html; charset=UTF-8",
+ };
+ this._statusCode = 200;
+ this._encoding = 'utf8';
+};
+
+/**
* HTTP Error
* @param code Status code
* @param reason Reason

0 comments on commit 3c11da8

Please sign in to comment.
Something went wrong with that request. Please try again.