2008: bug(lib): fix get dumps bad error code r=curquiza a=MarinPostma

fix bad error code being returned whet getting a dump status, and add a test
close #1994

Co-authored-by: Marin Postma <postma.marin@protonmail.com>
This commit is contained in:
bors[bot]
2021-12-15 18:58:17 +00:00
committed by GitHub
3 changed files with 28 additions and 4 deletions

View File

@ -59,10 +59,7 @@ impl ErrorCode for IndexControllerError {
IndexControllerError::DocumentFormatError(e) => e.error_code(),
IndexControllerError::MissingPayload(_) => Code::MissingPayload,
IndexControllerError::PayloadTooLarge => Code::PayloadTooLarge,
IndexControllerError::DumpError(DumpActorError::DumpAlreadyRunning) => {
Code::DumpAlreadyInProgress
}
IndexControllerError::DumpError(_) => Code::DumpProcessFailed,
IndexControllerError::DumpError(e) => e.error_code(),
}
}
}