Skip to content

Commit

Permalink
Release v2.1.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
yanzhenjie committed Feb 5, 2021
1 parent f4a14b6 commit a398285
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ buildscript {
}
dependencies {
classpath 'com.yanzhenjie.andserver:plugin:2.1.6'
classpath 'com.yanzhenjie.andserver:plugin:2.1.7'
...
}
}
Expand All @@ -125,8 +125,8 @@ apply plugin: 'com.yanzhenjie.andserver'
...
dependencies {
implementation 'com.yanzhenjie.andserver:api:2.1.6'
annotationProcessor 'com.yanzhenjie.andserver:processor:2.1.6'
implementation 'com.yanzhenjie.andserver:api:2.1.7'
annotationProcessor 'com.yanzhenjie.andserver:processor:2.1.7'
...
}
```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath "com.yanzhenjie.andserver:plugin:2.1.5"
classpath "com.yanzhenjie.andserver:plugin:2.1.7"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
android.useAndroidX=true

PROJECT_GROUP=com.yanzhenjie.andserver
PROJECT_VERSION=2.1.6
PROJECT_VERSION=2.1.7

POM_DESCRIPTION=Android web server.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void onStopped() {

@Override
public void onException(Exception e) {
e.printStackTrace();
ServerManager.onServerError(CoreService.this, e.getMessage());
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import androidx.annotation.NonNull;

import com.yanzhenjie.andserver.annotation.Resolver;
import com.yanzhenjie.andserver.error.BasicException;
import com.yanzhenjie.andserver.error.HttpException;
import com.yanzhenjie.andserver.framework.ExceptionResolver;
import com.yanzhenjie.andserver.framework.body.JsonBody;
import com.yanzhenjie.andserver.http.HttpRequest;
Expand All @@ -35,8 +35,8 @@ public class AppExceptionResolver implements ExceptionResolver {
@Override
public void onResolve(@NonNull HttpRequest request, @NonNull HttpResponse response, @NonNull Throwable e) {
e.printStackTrace();
if (e instanceof BasicException) {
BasicException exception = (BasicException) e;
if (e instanceof HttpException) {
HttpException exception = (HttpException) e;
response.setStatus(exception.getStatusCode());
} else {
response.setStatus(StatusCode.SC_INTERNAL_SERVER_ERROR);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import androidx.annotation.NonNull;

import com.yanzhenjie.andserver.annotation.Interceptor;
import com.yanzhenjie.andserver.error.BasicException;
import com.yanzhenjie.andserver.error.HttpException;
import com.yanzhenjie.andserver.framework.HandlerInterceptor;
import com.yanzhenjie.andserver.framework.handler.MethodHandler;
import com.yanzhenjie.andserver.framework.handler.RequestHandler;
Expand All @@ -44,7 +44,7 @@ public boolean onIntercept(@NonNull HttpRequest request, @NonNull HttpResponse r
MethodHandler methodHandler = (MethodHandler) handler;
Addition addition = methodHandler.getAddition();
if (!isLogin(request, addition)) {
throw new BasicException(401, "You are not logged in yet.");
throw new HttpException(401, "You are not logged in yet.");
}
}
return false;
Expand Down

0 comments on commit a398285

Please sign in to comment.