kopia lustrzana https://github.com/c9/core
also support oldclient and rename method to "on"
rodzic
d93801214b
commit
1e9afb398c
|
@ -115,7 +115,7 @@ function plugin(options, imports, register) {
|
|||
var accept = req.headers.accept || '';
|
||||
|
||||
if (statusCode == 500) {
|
||||
emitter.emit("serverError", {
|
||||
emitter.emit("internalServerError", {
|
||||
err: err,
|
||||
req: req
|
||||
});
|
||||
|
@ -169,9 +169,7 @@ function plugin(options, imports, register) {
|
|||
|
||||
register(null, {
|
||||
"connect.error": {
|
||||
onInternalServerError: function(handler) {
|
||||
emitter.on("serverError", handler);
|
||||
}
|
||||
on: emitter.on.bind(emitter)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -23,13 +23,9 @@ function plugin(options, imports, register) {
|
|||
var connectError = imports["connect.error"];
|
||||
var server = imports.http.getServer();
|
||||
|
||||
var noInternalServerErrors = !!options.noInternalServerErrors;
|
||||
|
||||
if (!noInternalServerErrors) {
|
||||
connectError.onInternalServerError(function(msg) {
|
||||
connectError.on("internalServerError", function(msg) {
|
||||
sendRequestError(msg.err, msg.req);
|
||||
});
|
||||
}
|
||||
|
||||
errorClient.user = warningClient.user = function(req) {
|
||||
return (req && req.user) ? req.user.name : "";
|
||||
|
|
Ładowanie…
Reference in New Issue