Bugfix 342

closed #342

I found `sendFailureMessage(Throwable e, String responseBody)` deprecated, so I didn't override it , put type check in `handleMessage` instead.