pierresouchay / consul-rust

Rust client libray for Consul HTTP API
Apache License 2.0
92 stars 48 forks source link

Handle non-JSON 404 Response on Session.renew PUT request #36

Open rodoyle opened 4 years ago

rodoyle commented 4 years ago

When Session::renew yields a 404 response Response: '404 Not Found' for http://localhost:8500/v1/session/renew/f933ddd8-c5a6-5d7e-898e-95fc8aebaadb? to a PUT request, the client will return the following JSON parse error Error(Msg("Failed to parse JSON"), State { next_error: Some(Error(Json(Error("expected value", line: 1, column: 1)))), backtrace: InternalBacktrace { backtrace: None } }

This is likely because the error responses are not valid JSON.