obsidian-rs / obsidian

Ergonomic async http framework for reliable and efficient web
MIT License
26 stars 4 forks source link

hotfix: deserializer panic while error occurs #60

Closed plwai closed 4 years ago

plwai commented 4 years ago

Issue

Program panic if providing wrong query names in an endpoint that parses uri query.

Correct Behaviour

Program return Result with Error.

Reproduce

  1. Make an endpoint which call uri_query method with struct data.
  2. Access the URL without query or with wrong query names.

Causes

When error occurs, serde do not call deprecated Error::description anymore instead of fmt. When calling to_string for Error, it calls fmt too. This makes infinite loop occurs and stack overflow. This only occurs at running app, test case would not fail. I am not sure why.