Skip to content

fix crash when not found; It might be better to remove the try-catch block #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/src/main/java/me/ghui/v2er/network/APIService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.google.gson.GsonBuilder;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.concurrent.TimeUnit;

import javax.annotation.Nullable;
Expand All @@ -26,6 +25,7 @@
import okhttp3.Response;
import okhttp3.ResponseBody;
import okhttp3.logging.HttpLoggingInterceptor;
import okio.Buffer;
import okio.BufferedSource;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
Expand Down Expand Up @@ -126,7 +126,7 @@ public Response intercept(Chain chain) throws IOException {
return new Response.Builder()
.protocol(Protocol.HTTP_1_1)
.code(404)
.message("Exeception when execute chain.proceed request")
.message("Exception when execute chain.proceed request")
.body(new ResponseBody() {
@Nullable
@Override
Expand All @@ -141,7 +141,7 @@ public long contentLength() {

@Override
public BufferedSource source() {
return null;
return new Buffer();
}
})
.request(request).build();
Expand Down