class HaloNetworkExceptionResolver {

    @NonNull
    @Api(2.0)
    public HaloNetException resolve(@NonNull Exception exception, @Nullable Request request, boolean isNetworkConnected) {
        HaloNetException exceptionMapped;
        String url = request != null ? request.url().toString() : null;
        if (!isNetworkConnected) {
            exceptionMapped = new HaloConnectionException("The device has not connectivity to reach the server on " + url, exception);
        } else {
            exceptionMapped = new HaloUnknownServerException("An unknown exception has been produced when performing the request: " + exception.getMessage(), exception);
        }
        return exceptionMapped;
    }

}