Skip to content

Commit

Permalink
Map Engine errors to DbusErrorEnum::ERROR instead of INTERNAL_ERROR
Browse files Browse the repository at this point in the history
Best to just use ERROR.

fixes stratis-storage#1181

Signed-off-by: Andy Grover <[email protected]>
  • Loading branch information
Andy Grover committed Sep 25, 2018
1 parent 174ab35 commit 700e75c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dbus_api/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ where
/// D-Bus methods return.
pub fn engine_to_dbus_err_tuple(err: &StratisError) -> (u16, String) {
let error = match *err {
StratisError::Error(_) => DbusErrorEnum::INTERNAL_ERROR,
StratisError::Error(_) => DbusErrorEnum::ERROR,
StratisError::Engine(ref e, _) => match *e {
ErrorEnum::Error => DbusErrorEnum::ERROR,
ErrorEnum::AlreadyExists => DbusErrorEnum::ALREADY_EXISTS,
Expand All @@ -60,7 +60,7 @@ pub fn engine_to_dbus_err_tuple(err: &StratisError) -> (u16, String) {
| StratisError::Serde(_)
| StratisError::DM(_)
| StratisError::Dbus(_)
| StratisError::Udev(_) => DbusErrorEnum::INTERNAL_ERROR,
| StratisError::Udev(_) => DbusErrorEnum::ERROR,
};
let description = match *err {
StratisError::DM(DmError::Core(ref err)) => err.to_string(),
Expand Down

0 comments on commit 700e75c

Please sign in to comment.