Skip to content

Commit

Permalink
Use base error and the error that happens while reverting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsik-sus committed May 6, 2024
1 parent 90bd73c commit 21104b9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions module/move/willbe/src/entity/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,12 @@ mod private
Ok( git ) => git,
Err( e ) =>
{
// use both errors
version_revert( &bump_report ).map_err( | le | ( report.clone(), le ) )?;
version_revert( &bump_report )
.map_err( | le |
(
report.clone(),
format_err!( "Base error:\n{}\nRevert error:\n{}", e.to_string().replace( '\n', "\n\t" ), le.to_string().replace( '\n', "\n\t" ) )
))?;
return Err(( report, e ));
}
};
Expand All @@ -471,8 +475,12 @@ mod private
Ok( publish ) => Some( publish ),
Err( e ) =>
{
// use both errors
git::reset( git_root.as_ref(), true, 1, false ).map_err( | le | ( report.clone(), le ) )?;
git::reset( git_root.as_ref(), true, 1, false )
.map_err( | le |
(
report.clone(),
format_err!( "Base error:\n{}\nRevert error:\n{}", e.to_string().replace( '\n', "\n\t" ), le.to_string().replace( '\n', "\n\t" ) )
))?;
return Err(( report, e ));
}
};
Expand Down

0 comments on commit 21104b9

Please sign in to comment.