handle thrift exceptions