GoogleCloudPlatform / ide-login

The plugins-login-common library for authenticating with the Google Cloud Platform shared by several IDE plugins including Google Cloud Tools for Eclipse, Google Cloud Tools for IntelliJ, and Android Studio.
Apache License 2.0
2 stars 9 forks source link

Catch and report exceptions when persisting account details #52

Closed briandealwis closed 6 years ago

briandealwis commented 6 years ago

Here's a first stab at #51 that catches and reports all exceptions when persisting accounts to the OAuthDataStore. I wasn't sure if it was worth reporting the exception messages to the user. But then again our users are developers and shouldn't be scared by an exception message.

Note that the JavaPreferenceOAuthDataStore does catch java.util.prefs.BackingStoreException.

Maybe we should just have a separate OAuthDataStoreException and have the implementations wrap and throw exceptions.

codecov[bot] commented 6 years ago

Codecov Report

Merging #52 into master will increase coverage by 1.8%. The diff coverage is 78.72%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #52     +/-   ##
=========================================
+ Coverage   78.76%   80.56%   +1.8%     
=========================================
  Files          10       10             
  Lines         226      247     +21     
  Branches       20       21      +1     
=========================================
+ Hits          178      199     +21     
  Misses         42       42             
  Partials        6        6
Impacted Files Coverage Δ
...loud/tools/login/JavaPreferenceOAuthDataStore.java 98.14% <100%> (+12.73%) :arrow_up:
...com/google/cloud/tools/login/GoogleLoginState.java 73.8% <66.66%> (-1.87%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b8a5e7a...00dde80. Read the comment docs.