Skip to content

Commit

Permalink
Merge pull request #105 from ngrok/josh/ngrok/error-code-prefix
Browse files Browse the repository at this point in the history
ngrok: don't trim the ERR_NGROK prefix from error codes
  • Loading branch information
jrobsonchase authored Aug 18, 2023
2 parents 4aa52ad + 5ae7e07 commit 339d9d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ngrok/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.13.1

- Preserve the `ERR_NGROK` prefix for error codes.

## 0.13.0

- Add the `NgrokError` trait
Expand Down
2 changes: 1 addition & 1 deletion ngrok/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ngrok"
version = "0.13.0"
version = "0.13.1"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "The ngrok agent SDK"
Expand Down
2 changes: 1 addition & 1 deletion ngrok/src/internals/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<'a> From<&'a str> for ErrResp {
let mut msg_lines = vec![];
for line in value.lines().filter(|l| !l.is_empty()) {
if line.starts_with("ERR_NGROK_") {
error_code = line.split('_').nth(2).map(String::from);
error_code = Some(line.trim().into());
} else {
msg_lines.push(line);
}
Expand Down

0 comments on commit 339d9d7

Please sign in to comment.