소스 검색

Proteus: Update handlers. (#4249)

noboomu 6 년 전
부모
커밋
831c56af62
1개의 변경된 파일22개의 추가작업 그리고 2개의 파일을 삭제
  1. 22 2
      frameworks/Java/proteus/src/main/java/io/sinistral/proteus/controllers/handlers/BenchmarksRouteSupplier.java

+ 22 - 2
frameworks/Java/proteus/src/main/java/io/sinistral/proteus/controllers/handlers/BenchmarksRouteSupplier.java

@@ -41,7 +41,17 @@ public class BenchmarksRouteSupplier implements Supplier<HttpHandler> {
       public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws
           java.lang.Exception {
 
-        benchmarksController.dbPostgres(exchange);
+            exchange.dispatch(() ->
+            {
+              try
+              {
+                benchmarksController.dbPostgres(exchange);
+              } catch (Exception e)
+              {
+                exchange.putAttachment(io.sinistral.proteus.server.handlers.ServerDefaultResponseListener.EXCEPTION, e);
+                exchange.endExchange();
+              }
+            });
       }
     };
 
@@ -76,7 +86,17 @@ public class BenchmarksRouteSupplier implements Supplier<HttpHandler> {
       public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws
           java.lang.Exception {
 
-        benchmarksController.fortunesPostgres(exchange);
+            exchange.dispatch(() ->
+            {
+              try
+              {
+                benchmarksController.fortunesPostgres(exchange);
+              } catch (Exception e)
+              {
+                exchange.putAttachment(io.sinistral.proteus.server.handlers.ServerDefaultResponseListener.EXCEPTION, e);
+                exchange.endExchange();
+              }
+            });
       }
     };