barseghyanartur / django-fobi

Form generator/builder application for Django done right: customisable, modular, user- and developer- friendly.
https://pypi.python.org/pypi/django-fobi
484 stars 112 forks source link

Hidden exceptions #221

Closed adrien-delhorme closed 5 years ago

adrien-delhorme commented 5 years ago

What is the reason for hiding, by default, the exceptions that could occur in form handlers and form plugins? I don't think its a good idea to hide errors.

I think these default settings should be set to True:

FAIL_ON_ERRORS_IN_FORM_ELEMENT_PLUGINS = False
FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS = False
FOBI_FAIL_ON_MISSING_INTEGRATION_FORM_ELEMENT_PLUGINS = False
FOBI_FAIL_ON_MISSING_INTEGRATION_FORM_HANDLER_PLUGINS = False
barseghyanartur commented 5 years ago

A lot of fobi configuration is based valid json.

If something goes wrong, you'll get errors in production.

It's configurable, thus everyone might do whatever is right for his case.

adrien-delhorme commented 5 years ago

I'm sorry to insist, but I actually lost many user data because an UnicodeEncodeError occurred in the db_store handler (PR #222) and was hidden by the setting FOBI_FAIL_ON_ERRORS_IN_FORM_HANDLER_PLUGINS = False. In production, no errors were thrown, and the users reach the success page without guessing their data were actually lost.

I understand it's configurable but I think the default should be to not hide errors.

To quote the Zen of Python: "Errors should never pass silently".

barseghyanartur commented 5 years ago

I see. Well, agreed then. Could you make a pr?

adrien-delhorme commented 5 years ago

Yes! #223

barseghyanartur commented 5 years ago

Solved in 0.15.