ngrok / ngrok-rust

Embed ngrok secure ingress into your Rust apps with a single line of code.
Apache License 2.0
310 stars 18 forks source link

ngrok: parse error responses and surface the msg and code #104

Closed jrobsonchase closed 1 year ago

jrobsonchase commented 1 year ago

Resolves ngrok-private/ngrok#21498

Adds an ErrResp proto struct and an NgrokError trait.

The ErrResp gets parsed from the stringly-typed error message that comes from tunnel protocol RPC calls, and holds both the messge and code fields. The NgrokError trait allows us to bubble these fields up through the thiserror wrappings to make it easier to get the ngrok code/message at the top-level, i.e. ConnectError and RpcError.

bobzilladev commented 1 year ago

Nice, thanks for doing this parsing.

I started seeing that oauth error in similar tests for python, in addition to google-site-verification i also search for the generic accounts.google.com which seems currently dependable.