stan-dev / pystan

PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io
ISC License
342 stars 59 forks source link

fix: fix "'message' key error" in error reporting #313

Closed li-sicong closed 3 years ago

li-sicong commented 3 years ago

Some error cases do not set 'message' field in the response. Handle such cases by propagating the full response.

riddell-stan commented 3 years ago

Do you have an example which triggers this case? The root cause of this problem might lie elsewhere.

li-sicong commented 3 years ago

Do you have an example which triggers this case? The root cause of this problem might lie elsewhere.

Yes. The error was found when I passed a list to data argument in stan.build instead of a dictionary. I think this caused an exception to be raised in the marshmallow package but was not handled, resulting in a confusing error message.

riddell-stan commented 3 years ago

I don't object to figuring out a solution to this problem. However, we need more discussion. I suspect something might need to be changed in httpstan.

If you want to pursue this, open a bug report with a minimal example showing how the (unhelpful) error arises.