File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
jetty/src/main/scala/com/avsystem/commons/jetty/rpc Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -109,15 +109,17 @@ object JettyRPCFramework extends StandardRPCFramework with LazyLogging {
109109 code
110110 asyncContext.complete()
111111 }
112- completeWith( Future .fromTry(call).flatMapNow(handlePost).andThenNow {
112+ Future .fromTry(call).flatMapNow(handlePost).onCompleteNow {
113113 case Success (responseContent) =>
114- response.setContentType(MimeTypes .Type .APPLICATION_JSON .asString())
115- response.setCharacterEncoding(StandardCharsets .UTF_8 .name())
116- response.getWriter.write(responseContent.s)
114+ completeWith {
115+ response.setContentType(MimeTypes .Type .APPLICATION_JSON .asString())
116+ response.setCharacterEncoding(StandardCharsets .UTF_8 .name())
117+ response.getWriter.write(responseContent.s)
118+ }
117119 case Failure (t) =>
118- response.sendError(HttpStatus .INTERNAL_SERVER_ERROR_500 , t.getMessage)
120+ completeWith( response.sendError(HttpStatus .INTERNAL_SERVER_ERROR_500 , t.getMessage) )
119121 logger.error(" Failed to handle RPC call" , t)
120- })
122+ }
121123 case HttpMethod .PUT =>
122124 call.map(handlePut).get
123125 case _ =>
You can’t perform that action at this time.
0 commit comments