mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
Cleanup ignored exceptions
This commit is contained in:
@ -118,28 +118,24 @@ class GitNoteRepository {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ignoredMessages = [
|
||||||
|
'connection timed out',
|
||||||
|
'failed to resolve address for',
|
||||||
|
'failed to connect to',
|
||||||
|
'no address associated with hostname',
|
||||||
|
'unauthorized',
|
||||||
|
'invalid credentials',
|
||||||
|
'failed to start ssh session',
|
||||||
|
'failure while draining',
|
||||||
|
'network is unreachable',
|
||||||
|
];
|
||||||
|
|
||||||
bool shouldLogGitException(GitException ex) {
|
bool shouldLogGitException(GitException ex) {
|
||||||
var msg = ex.cause.toLowerCase();
|
var msg = ex.cause.toLowerCase();
|
||||||
if (msg.contains("failed to resolve address for")) {
|
for (var i = 0; i < ignoredMessages.length; i++) {
|
||||||
|
if (msg.contains(ignoredMessages[i])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (msg.contains("failed to connect to")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (msg.contains("no address associated with hostname")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (msg.contains("failed to connect to")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (msg.contains("unauthorized")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (msg.contains("invalid credentials")) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (msg.contains("failed to start ssh session")) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user