forked from the-distro/ofborg
commitstatuserror: handle each error case separately, not based on 'internal' error
This commit is contained in:
parent
8e6f78607b
commit
e65a24aa89
|
@ -75,15 +75,6 @@ pub enum CommitStatusError {
|
|||
Error(hubcaps::Error),
|
||||
}
|
||||
|
||||
impl CommitStatusError {
|
||||
pub fn is_internal_error(&self) -> bool {
|
||||
match self {
|
||||
CommitStatusError::MissingSHA(_) => false,
|
||||
CommitStatusError::Error(_) => true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<hubcaps::Error> for CommitStatusError {
|
||||
fn from(e: hubcaps::Error) -> CommitStatusError {
|
||||
use hyper::status::StatusCode;
|
||||
|
|
|
@ -226,13 +226,15 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
|
|||
|
||||
self.actions().skip(&self.job)
|
||||
}
|
||||
Err(Err(cswerr)) if !cswerr.is_internal_error() => {
|
||||
error!("Ignorable error writing commit status: {:?}", cswerr);
|
||||
|
||||
Err(Err(CommitStatusError::MissingSHA(e))) => {
|
||||
error!(
|
||||
"Failed writing commit status: commit sha was force-pushed away: {:?}",
|
||||
e
|
||||
);
|
||||
self.actions().skip(&self.job)
|
||||
}
|
||||
|
||||
Err(Err(cswerr)) => {
|
||||
Err(Err(CommitStatusError::Error(cswerr))) => {
|
||||
error!(
|
||||
"Internal error writing commit status: {:?}, marking internal error",
|
||||
cswerr
|
||||
|
|
Loading…
Reference in a new issue