Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Exception Handling Improvements #4217

Open
tinakurian opened this issue Aug 20, 2018 · 0 comments
Open

Exception Handling Improvements #4217

tinakurian opened this issue Aug 20, 2018 · 0 comments

Comments

@tinakurian
Copy link

tinakurian commented Aug 20, 2018

Issue Overview

Exception handling in Launcher Backend can be improved.

Currently, there are some examples of the following:
"RuntimeException" and "IllegalArgumentException" being thrown:
public Optional<GitHook> getHook(final GitRepository repository, final URL url) throws IllegalArgumentException { ... }

Exceptions are caught and swallowed:

this.httpClient.executeAndConsume(request, response -> {
            if (!response.isSuccessful()) {
                String message = response.message();
                try {
                    ResponseBody body = response.body();
                    if (body != null) {
                        message = body.string();
                    }
                } catch (IOException io) {
                    // ignore
                }
                throw new HttpException(response.code(), message);
            }
        });

Perhaps, exception handling is an area that we can consider improving.

Expected Behaviour

Generic exceptions should never be thrown.
Exceptions should never be swallowed.

Current Behaviour

Generic exceptions are thrown.
Exceptions are swallowed in some places.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant