mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
05c3f459ad
commit
0de49e2a75
@ -43,10 +43,16 @@ module.exports = {
|
||||
rejectHandler: function(req,res,err) {
|
||||
//TODO: why this when errorHandler also?!
|
||||
log.audit({event: "api.error",error:err.code||"unexpected_error",message:err.message||err.toString()},req);
|
||||
res.status(err.status||400).json({
|
||||
var response = {
|
||||
code: err.code||"unexpected_error",
|
||||
message: err.message||err.toString()
|
||||
});
|
||||
};
|
||||
// Handle auth failures on a specific remote
|
||||
// TODO: don't hardcode this here - allow users of rejectHandler to identify extra props to send
|
||||
if (err.remote) {
|
||||
response.remote = err.remote;
|
||||
}
|
||||
res.status(err.status||400).json(response);
|
||||
},
|
||||
getRequestLogObject: function(req) {
|
||||
return {
|
||||
|
@ -706,7 +706,9 @@ Project.prototype.fetch = function(user,remoteName) {
|
||||
promise = promise.then(function() {
|
||||
return gitTools.fetch(project.path,remote,authCache.get(project.name,project.remotes[remote].fetch,username))
|
||||
}).catch(function(err) {
|
||||
if (!err.remote) {
|
||||
err.remote = remote;
|
||||
}
|
||||
throw err;
|
||||
})
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user