File tree 1 file changed +8
-6
lines changed
jetty/src/main/scala/com/avsystem/commons/jetty/rpc
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 {
109
109
code
110
110
asyncContext.complete()
111
111
}
112
- completeWith( Future .fromTry(call).flatMapNow(handlePost).andThenNow {
112
+ Future .fromTry(call).flatMapNow(handlePost).onCompleteNow {
113
113
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
+ }
117
119
case Failure (t) =>
118
- response.sendError(HttpStatus .INTERNAL_SERVER_ERROR_500 , t.getMessage)
120
+ completeWith( response.sendError(HttpStatus .INTERNAL_SERVER_ERROR_500 , t.getMessage) )
119
121
logger.error(" Failed to handle RPC call" , t)
120
- })
122
+ }
121
123
case HttpMethod .PUT =>
122
124
call.map(handlePut).get
123
125
case _ =>
You can’t perform that action at this time.
0 commit comments