Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error related end-user experience #333

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on Mar 18, 2022

  1. raise specific exceptions during value retrieval and processing

    This makes it easier to determine what exactly went wrong and thus build
    better error handling in a later commit.
    Tests were adapted accordingly to assert that only those specific errors
    are raised instead of the plain ValueErrors.
    ftsell committed Mar 18, 2022
    Configuration menu
    Copy the full SHA
    6427a32 View commit details
    Browse the repository at this point in the history
  2. fix raised error on required BooleanValue and invalid default

    Previously and ImproperlyConfigured error was always raised when an invalid
    default configured for the BooleanValue class.
    This behavior is unnecessary if the default is never used because the
    value is marked as environ_required.
    The check has thus been adapted to ignore invalid defaults in that case.
    ftsell committed Mar 18, 2022
    Configuration menu
    Copy the full SHA
    0ec0a4c View commit details
    Browse the repository at this point in the history
  3. add custom error handling for own exceptions

    This introduces a function that wraps django entry points with an error
    handler so that our own exception can be pretty-printed to an end-user
    without a large stack-trace.
    The defined error handler has also been applied to the existing
    management, wsgi, asgi and fastcgi entry point definitions.
    ftsell committed Mar 18, 2022
    Configuration menu
    Copy the full SHA
    7e05c08 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a33b77a View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2022

  1. Configuration menu
    Copy the full SHA
    ece1521 View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2022

  1. Configuration menu
    Copy the full SHA
    7de2615 View commit details
    Browse the repository at this point in the history
  2. implement error accumulation

    This way, multiple ConfigurationErrors are caught during setup, accumulated and printed all at once
    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    a3b720f View commit details
    Browse the repository at this point in the history
  3. add support for adding help_text to values

    Now Value classes accept a 'help_text' keyword which will get printed when a
    ValueRetrievalError or ValueProcessingError occurs
    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    50ac28b View commit details
    Browse the repository at this point in the history
  4. add support for adding reference links to values

    Now Value classes accept a 'help_reference' keyword which will get printed when a
    ValueRetrievalError or ValueProcessingError occurs
    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    12ffda4 View commit details
    Browse the repository at this point in the history
  5. fix failing 'test_email_url_value' test

    See #332
    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    42ab54f View commit details
    Browse the repository at this point in the history
  6. fix failing 'test_cache_url_value' test

    The test failed for two reasons. One was me changing the error string in a previous commit which
    I have adapted the test for now.
    The other was that django-cache-url changed its behavior. See #332
    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    a7f0606 View commit details
    Browse the repository at this point in the history
  7. fix flake8 warnings

    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    fd1b571 View commit details
    Browse the repository at this point in the history
  8. implement example generators

    Example generators are an addition to the 'Value' classes that allow the error handler to display
    example values for the failed value.
    For example if no django secret key is found to be defined in the environment, an example (secure)
    value for such a secret key can now be generated on the fly and be suggested to the user
    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    5cd3a86 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    3b96d16 View commit details
    Browse the repository at this point in the history
  10. add tests for error handling

    ftsell committed Mar 24, 2022
    Configuration menu
    Copy the full SHA
    b21f207 View commit details
    Browse the repository at this point in the history