riffed icon indicating copy to clipboard operation
riffed copied to clipboard

Add exceptions

Open scohen opened this issue 8 years ago • 10 comments

This PR adds exceptions to the client, server and struct modules. It's dependent on thrift 0.10 though, and targets the 1.5 branch.

scohen avatar Apr 12 '16 21:04 scohen

@laozhp @tbug How is this?

scohen avatar Apr 12 '16 21:04 scohen

Maybe this should require Thrift 0.10 in mix.exs (via thrift_version).

The .travis.yml script will also need to an update to use Thrift 0.10 in the CI environment.

jparise avatar Apr 12 '16 22:04 jparise

Good job! I had found the generated struct_names() not include exception names, so I add a PR(https://github.com/apache/thrift/pull/975) to thrift compiler to generate exception_names() meta info.

laozhp avatar Apr 13 '16 15:04 laozhp

@jparise I can't, it's not out yet.

@laozhp Thanks for putting that fix in; I'm sad to say that I omitted exceptions when I made the original change. Once this lands, I can just ask for the exceptions rather than relying on them not being in the struct list.

scohen avatar Apr 13 '16 20:04 scohen

Sorry for not getting back sooner. I'll take a look at this asap, but at first glance it looks great 👍

tudborg avatar Apr 20 '16 09:04 tudborg

Ah, sorry for not getting back. I'm having trouble building thrift 0.10, havn't had time to debug the issue yet.

tudborg avatar May 17 '16 14:05 tudborg

@tbug apparently, so is apache ;)

To say we're disappointed with the speed of thrift releases is an understatement.

scohen avatar May 18 '16 15:05 scohen

@scohen Ha, alright. I guess I'm happy it's not just me then 😄

I'm not really following thrift dev, so I have no idea how far we are from 0.10, but I'd expect it to be around the corner? Out of curiosity, which parts of this PR depends on 0.10?

tudborg avatar May 18 '16 19:05 tudborg

@tbug As far as I can tell from the outside, they've tagged the release and are now doing... something.

This PR relies on deeper metadata around functions and exceptions, which were added to 0.10.

scohen avatar May 18 '16 20:05 scohen

@binaryseed Sorry it's been so long, but I updated exception handling on the v1_5_0 branch. Please give it a shot. I also made full end-to-end unit tests so that I can be sure that both the server and client handle exceptions properly.

scohen avatar Aug 31 '16 04:08 scohen