package com.github.gotify.api; import java.io.IOException; import retrofit2.Call; import retrofit2.Response; public class Api { public static T execute(Call call) throws ApiException { try { Response response = call.execute(); if (response.isSuccessful()) { return response.body(); } else { throw new ApiException(response); } } catch (IOException e) { throw new ApiException(e); } } }