Skip to content

Commit

Permalink
Preserve case of server error messages
Browse files Browse the repository at this point in the history
Server errors can contain case-sensitive values like subject names which
can cause confusion if not displayed in their original case.
  • Loading branch information
oscarwcl authored and Jarema committed May 13, 2024
1 parent c182230 commit d8b59e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion async-nats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,8 @@ impl ServerError {
fn new(error: String) -> ServerError {
match error.to_lowercase().as_str() {
"authorization violation" => ServerError::AuthorizationViolation,
other => ServerError::Other(other.to_string()),
// error messages can contain case-sensitive values which should be preserved
_ => ServerError::Other(error),
}
}
}
Expand Down

0 comments on commit d8b59e0

Please sign in to comment.