s7/scale7-pelops — Issue #45: Improve wrapping of exceptions from Cassandra Thrift
Author: eryabitskiy
Created: 2011-10-10 09:47:32+00:00
State: open

In current implementation Pelops has wrappers for all Cassandra Thrift exceptions.

It will be much better to have all Exception information in stack trace. Current Thrift implementation return this info on getWhy().
And getMessage() return null.
So it will be much better to use getWhy as message while wraaping:

public static class ExceptionTranslator implements IExceptionTranslator {
@Override
public PelopsException translate(Exception e) {
if (e instanceof org.apache.cassandra.thrift.NotFoundException)
return new NotFoundException(e);
....

chage to:

public static class ExceptionTranslator implements IExceptionTranslator {
@Override
public PelopsException translate(Exception e) {
if (e instanceof org.apache.cassandra.thrift.NotFoundException)
return new NotFoundException(e.getWhy(), e); // add getWhy() as message.
....