Skip to content

Fixed null pointer exceptions caused by missing or broken configuration file#48

Closed
GideonLeGrange wants to merge 1 commit into
XeroAPI:masterfrom
GideonLeGrange:master
Closed

Fixed null pointer exceptions caused by missing or broken configuration file#48
GideonLeGrange wants to merge 1 commit into
XeroAPI:masterfrom
GideonLeGrange:master

Conversation

@GideonLeGrange
Copy link
Copy Markdown

@GideonLeGrange GideonLeGrange commented Aug 12, 2017

This PR fixes two related problems:

  • The user instantiates the API with a missing JSON config file. This causes a null pointer error
  • There is a problem reading the JSON config which causes a further null pointer (after printing stack traces)

To fix this, I introduce a new exception XeroClientException. I did not want to re-use XeroApiException since this is thrown on failures which happen before the remote API is called. XeroClientException extends RuntimeException so there should be no impact on backwards compatibility.

@GideonLeGrange GideonLeGrange changed the title Fixed null pointer exceptions caused by missing configuration file Fixed null pointer exceptions caused by missing or broken configuration file Aug 12, 2017
SidneyAllen added a commit that referenced this pull request Sep 22, 2017
If config.json missing - throw a runtime error and catch it.
@SidneyAllen
Copy link
Copy Markdown
Contributor

Tested successfully and merged - thank you!

SidneyAllen added a commit that referenced this pull request Sep 22, 2017
tested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants