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

Surpress KeyError when applications are missing #367

Merged
merged 4 commits into from
Nov 25, 2019

Commits on Nov 20, 2019

  1. Surpress KeyError when applications are missing

    The following surpresses a KeyError when a application or a remote
    application is missing. Instead we should return None and correctly
    handle that a application or a remote-application could be missing.
    
    This should be safe to do so and the fact that an update from the
    all watcher should fill in the gaps eventually. If this is not the
    case, we should in the future ensure that a remote-application can't
    raise index/key errors when data is missing.
    
    The missing data when raised/thrown criples the library from being
    useful, instead we should really handle all the cases these exist and
    correctly insert None or a fallback.
    SimonRichardson committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    279a055 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. Raise error

    After having a long internal discussion around this, it's evident that
    this will cause errors down the line at some point. Instead we've
    decided that it's better to throw a custom error, one that can be caught
    individually to force the user of the library to disconnect and
    reconnect from the model, to pick up any missing deltas.
    
    This can be done in a way to the examples/model.py where retries can be
    forced to happen when an exception is raised.
    
    This code to change this is very rudimental and just exposes a new juju
    error - JujuEntityNotFoundError. I've also updated the test to fully
    expose the exception at a unit level.
    SimonRichardson committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    46d2b2f View commit details
    Browse the repository at this point in the history
  2. Ensure we handle application offers

    The following changes consume application offers, so that they're
    correctly picked up.
    SimonRichardson committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    8f84084 View commit details
    Browse the repository at this point in the history
  3. Log a warning rather than a debug

    This should help identify issues in the future.
    SimonRichardson committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    30fbbfb View commit details
    Browse the repository at this point in the history