private Issue addIssueOrThrow(Repository repository, Response<Issue> response,
                                  @StringRes int error) {
        if (response.isSuccessful()) {
            return addIssue(repository, response.body());
        } else {
            Toast.makeText(context, error, Toast.LENGTH_SHORT).show();
            return Issue.builder().build();
        }
    }
Adds the issue from the response or throws an error if the request was unsuccessful.

@param repository The issues repository
@param response The issue response to add
@param error String to print if unsuccessful
@return The added issue
app/src/main/java/com/github/pockethub/android/core/issue/IssueStore.java