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),
|
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 {
|
impl From<hubcaps::Error> for CommitStatusError {
|
||||||
fn from(e: hubcaps::Error) -> CommitStatusError {
|
fn from(e: hubcaps::Error) -> CommitStatusError {
|
||||||
use hyper::status::StatusCode;
|
use hyper::status::StatusCode;
|
||||||
|
|
|
@ -226,13 +226,15 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
|
||||||
|
|
||||||
self.actions().skip(&self.job)
|
self.actions().skip(&self.job)
|
||||||
}
|
}
|
||||||
Err(Err(cswerr)) if !cswerr.is_internal_error() => {
|
Err(Err(CommitStatusError::MissingSHA(e))) => {
|
||||||
error!("Ignorable error writing commit status: {:?}", cswerr);
|
error!(
|
||||||
|
"Failed writing commit status: commit sha was force-pushed away: {:?}",
|
||||||
|
e
|
||||||
|
);
|
||||||
self.actions().skip(&self.job)
|
self.actions().skip(&self.job)
|
||||||
}
|
}
|
||||||
|
|
||||||
Err(Err(cswerr)) => {
|
Err(Err(CommitStatusError::Error(cswerr))) => {
|
||||||
error!(
|
error!(
|
||||||
"Internal error writing commit status: {:?}, marking internal error",
|
"Internal error writing commit status: {:?}, marking internal error",
|
||||||
cswerr
|
cswerr
|
||||||
|
|
Loading…
Reference in a new issue