Skip to content

Commit

Permalink
📘 update blade version and add validator
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Jul 31, 2017
1 parent f1b11fe commit 003ccc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<groupId>io.github.junicorn</groupId>
<artifactId>tale</artifactId>
<version>1.3.0-alpha</version>
<version>1.3.0-alpha1</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sqlite.version>3.15.1</sqlite.version>
<blade-mvc.version>2.0.1-alpha</blade-mvc.version>
<blade-mvc.version>2.0.1-alpha2</blade-mvc.version>
<blade-jdbc.version>0.1.6-beta</blade-jdbc.version>
<blade-tpl.verion>0.1.0</blade-tpl.verion>
<commonmark.version>0.9.0</commonmark.version>
Expand Down Expand Up @@ -151,7 +151,6 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!--mvn clean package assembly:single -Pprod -Dmaven.test.skip=true-->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/tale/exception/GolbalExceptionResolve.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.blade.exception.ExceptionResolve;
import com.blade.ioc.annotation.Bean;
import com.blade.mvc.hook.Invoker;
import com.blade.mvc.hook.Signature;
import com.blade.mvc.ui.RestResponse;
import com.blade.validator.exception.ValidateException;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -17,11 +17,11 @@
public class GolbalExceptionResolve implements ExceptionResolve {

@Override
public boolean handle(Exception e, Invoker invoker) {
public boolean handle(Exception e, Signature signature) {
if (e instanceof ValidateException) {
ValidateException validateException = (ValidateException) e;
String msg = validateException.getErrMsg();
invoker.response().json(RestResponse.fail(msg));
signature.response().json(RestResponse.fail(msg));
return false;
}
return true;
Expand Down

0 comments on commit 003ccc2

Please sign in to comment.