Skip to content

Commit

Permalink
(*) fix request failure, made response bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jymot committed Aug 1, 2016
1 parent ba26575 commit c78ef7e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
okhttp wrapper
###Gradle:
```gradle
compile 'im.wangchao:mhttp:1.2.2'
compile 'im.wangchao:mhttp:1.2.3'
```
###PROGUARD
ProGuard rules now ship inside of the library and are included automatically.
Expand Down
2 changes: 1 addition & 1 deletion mhttp/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
PROJ_GROUP=im.wangchao
PROJ_VERSION=1.2.2
PROJ_VERSION=1.2.3
PROJ_NAME=mhttp
PROJ_WEBSITEURL=http://wangchao.im/2015/11/22/mhttpadapter-post.html
PROJ_ISSUETRACKERURL=https://github.com/motcwang/MHttp/issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import im.wangchao.mhttp.internal.exception.ParserException;
import im.wangchao.mhttp.internal.exception.ResponseFailException;
import okhttp3.Call;
import okhttp3.Protocol;
import okhttp3.Response;

/**
Expand Down Expand Up @@ -67,7 +68,12 @@ protected void onFinish(){}

OkRequest requestRef = request;
OkResponse okResponse = MResponse.builder()
.response(new Response.Builder().code(AbsCallbackHandler.IO_EXCEPTION_CODE).message(e.getMessage()).build())
.response(new Response.Builder()
.request(requestRef.request())
.protocol(Protocol.HTTP_1_1)
.code(AbsCallbackHandler.IO_EXCEPTION_CODE)
.message(e.getMessage())
.build())
.request(requestRef)
.builder();
sendFailureMessage(okResponse, e);
Expand Down

0 comments on commit c78ef7e

Please sign in to comment.