-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
The current REST interactions with the API frequently swallow errors and throw up NullPointerExceptions without much warning.
A more robust error handling system is in order. It should give the user the option to check for errors wherever the library sends a request. This may require rather large breaking changes.
Take DestinyAPI.getMemberFromSteamID
We want to wrap the return with some sort of container which can be checked.
public static Response<BungieUser> getMemberFromSteamID(String steamID) {
return getMemberFromPlatformID("SteamId", steamID);
}Then when handling the result we should be able to use functions like
response.isOkay() // if the request completed ok
response.isError() // api returned an error
response.getErrorMessage() // return error message from api
response.inner() // returns the BungieUser object
response.isApiOnline() // is the api online? or was it another error
response.inherit(new object) // pass error messages and such with a new object, like converting jsonobject to BungieUserMetadata
Metadata
Assignees
Labels
No labels