Comparing version 0.1.8 to 0.1.9
@@ -18,3 +18,2 @@ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved. | ||
// Just force this to extend http.ServerResponse | ||
@@ -25,2 +24,19 @@ require('./http-extra'); | ||
var _eHandlerInstalled = false; | ||
function _installExceptionHandler() { | ||
if (_eHandlerInstalled) return true; | ||
process.on('uncaughtException', function(e) { | ||
log.warn('uncaughtException: ' + (e.stack ? e.stack : e)); | ||
if (_response) { | ||
_response.writeHead(HttpCodes.InternalError); | ||
_response.end(); | ||
_response = null; | ||
} | ||
}); | ||
_eHandlerInstalled = true; | ||
} | ||
function _sanitizePath(path) { | ||
@@ -403,2 +419,3 @@ assert.ok(path); | ||
var installedExceptionHandler = false; | ||
if (options) { | ||
@@ -413,2 +430,3 @@ if (options.apiVersion) { | ||
process.on('uncaughtException', options.exceptionHandler); | ||
installedExceptionHandler = true; | ||
} | ||
@@ -442,13 +460,4 @@ if (options.maxRequestSize) { | ||
} | ||
if (!options && | ||
!options.exceptionHandler) { | ||
process.on('uncaughtException', function(e) { | ||
log.warn('uncaughtException: ' + (e.stack ? e.stack : e)); | ||
if (_response) { | ||
_response.writeHead(HttpCodes.InternalError); | ||
_response.end(); | ||
_response = null; | ||
} | ||
}); | ||
if (!installedExceptionHandler) { | ||
_installExceptionHandler(); | ||
} | ||
@@ -455,0 +464,0 @@ |
{ | ||
"name": "restify", | ||
"description": "REST framework specifically meant for web service APIs", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92770
1461