Thread real upstream-connect errors into audit records as failDetail (#19)
resolveAndConnect discarded the actual error from connectUpstream (ECONNREFUSED, ETIMEDOUT, an ssh2 auth failure, ...) and replaced it with the generic reason string 'upstream-unreachable', so the audit log gave no way to tell a network-layer failure from an auth failure -- which is why "Could not reach 192.168.1.206" for the emby host couldn't be root-caused without live host-shell access. Now the real error message is captured and surfaced as failDetail, shown as a tooltip on the audit table's fail badge.
This commit is contained in:
@@ -27,5 +27,6 @@ app.apiToken = (function(app){
|
||||
// Shared render helpers.
|
||||
app.jump.fmtTime = function(ts){ return ts ? moment(Number(ts)).format('YYYY-MM-DD HH:mm:ss') : '—'; };
|
||||
app.jump.esc = function(s){ return $('<div>').text(s == null ? '' : String(s)).html(); };
|
||||
app.jump.result = function(e){ return e.success ? '<span class="badge bg-success">ok</span>'
|
||||
: '<span class="badge bg-danger">' + app.jump.esc(e.failReason || 'fail') + '</span>'; };
|
||||
app.jump.result = function(e){ if (e.success) return '<span class="badge bg-success">ok</span>';
|
||||
var title = e.failDetail ? ' title="' + app.jump.esc(e.failDetail) + '"' : '';
|
||||
return '<span class="badge bg-danger"' + title + '>' + app.jump.esc(e.failReason || 'fail') + '</span>'; };
|
||||
|
||||
Reference in New Issue
Block a user