Thrift IDL tips

17 Jan 2013

  • Thrift IDL is compiled in order. Therefore, you cannot have struct A that uses struct B, but A is above B. You cannot do that
  • When defining exceptions thrown from a method, you have to name it differently. It is kind of annoying…

Instead of:

void create() throws ( 1: ValidationError e, 2: InternalServerError e, 3: AccessDeniedError e, 4: TimeOutError e)

I have to do:

void create() throws ( 1: ValidationError validation, 2: InternalServerError internal, 3: AccessDeniedError accessDenied, 4: TimeOutError timeOut)

Give it a kudos