request.setParams(paramList);
try {
agent.sendRequest(request);
- } catch (Throwable t) {
+ } catch (Exception e) {
}
resp.setId(req.getId());
try {
agent.sendResponse(resp);
- } catch (Throwable t) {
+ } catch (Exception e) {
LOG.warn("Response {} could not be sent to {}", resp, agent);
}
public void run() {
try {
ctx.getPeer().sendResponse(resp);
- } catch (Throwable t) {
+ } catch (Exception e) {
// TODO: what to do here
}
request.setParams(paramsList);
try {
agent.sendRequest(request);
- } catch (Throwable t) {
+ } catch (Exception e) {
}
}
if (response != null) {
try {
endpoint.sendResponse(response);
- } catch (Throwable t) {
- LOG.warn("Error sending response {}", t);
+ } catch (Exception e) {
+ LOG.warn("Error sending response {}", e);
}
}
* @param message The concrete {@link RpcMessage} to send
* @return SettableFuture<Object> The caller can use the returned
* object to wait for the response (currently no timeout)
- * @throws Throwable The concrete message couldn't be serialized and sent
+ * @throws Exception The concrete message couldn't be serialized and sent
*/
- public SettableFuture<Object> sendRequest(RpcMessage message) throws Throwable {
+ public SettableFuture<Object> sendRequest(RpcMessage message) throws Exception {
if (messageMap.get(message.getName()) == null) {
return null;
}
* Send a response to a previous {@link RpcMessage}request
*
* @param message The concrete {@link RpcMessage}
- * @throws Throwable The concrete message couldn't be serialized and sent
+ * @throws Exception The concrete message couldn't be serialized and sent
*/
- public void sendResponse (RpcMessage message) throws Throwable {
+ public void sendResponse (RpcMessage message) throws Exception {
String s = objectMapper.writeValueAsString(message) + "\0";
logger.trace("sendResponse: {}", s);
*/
try {
endpoint.sendResponse(response);
- } catch (Throwable e) {
- logger.error("Throwable for sending {}, {}", message, e);
+ } catch (Exception e) {
+ logger.error("Exception for sending {}, {}", message, e);
}
}
try {
endpoint.sendRequest(ourId);
- } catch (Throwable t) {
- logger.error("Couldn't send Identity {}", t);
+ } catch (Exception e) {
+ logger.error("Couldn't send Identity {}", e);
}
}
assertTrue(result.toString().contains("method"));
assertTrue(result.toString().contains("params"));
channel.finish();
- } catch ( Throwable e ) {
+ } catch ( Exception e ) {
fail();
}
}
Object tmp = lf.get();
assertTrue(tmp instanceof JsonRpcEndpointTest.OpflexTest);
channel.finish();
- } catch ( Throwable e ) {
+ } catch ( Exception e ) {
fail();
}
}