Skip to content

Commit 4961769

Browse files
authored
fix: include mint address in error display strings (#386)
1 parent c75e589 commit 4961769

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/errors.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ pub type NetworkError = String;
2222

2323
#[derive(Error, Debug)]
2424
pub enum MigrateError {
25-
#[error("Migration failed with error: {1}")]
25+
#[error("Migration failed for mint {0}: {1}")]
2626
MigrationFailed(MintAddress, NetworkError),
2727
}
2828

2929
#[derive(Error, Debug)]
3030
pub enum UpdateError {
31-
#[error("Action failed with error: {1}")]
31+
#[error("Action failed for mint {0}: {1}")]
3232
UpdateFailed(MintAddress, NetworkError),
3333
}
3434

3535
#[derive(Error, Debug)]
3636
pub enum ActionError {
37-
#[error("Action failed with error: {1}")]
37+
#[error("Action failed for mint {0}: {1}")]
3838
ActionFailed(MintAddress, NetworkError),
3939
}
4040

@@ -95,7 +95,7 @@ mod tests {
9595
);
9696
assert_eq!(
9797
err.to_string(),
98-
"Migration failed with error: connection refused"
98+
"Migration failed for mint AbcDef123: connection refused"
9999
);
100100
}
101101

@@ -104,15 +104,15 @@ mod tests {
104104
#[test]
105105
fn update_error_display() {
106106
let err = UpdateError::UpdateFailed("mint123".to_string(), "tx failed".to_string());
107-
assert_eq!(err.to_string(), "Action failed with error: tx failed");
107+
assert_eq!(err.to_string(), "Action failed for mint mint123: tx failed");
108108
}
109109

110110
// ActionError tests
111111

112112
#[test]
113113
fn action_error_display() {
114114
let err = ActionError::ActionFailed("mint456".to_string(), "timeout".to_string());
115-
assert_eq!(err.to_string(), "Action failed with error: timeout");
115+
assert_eq!(err.to_string(), "Action failed for mint mint456: timeout");
116116
}
117117

118118
// SolConfigError tests

0 commit comments

Comments
 (0)