idl - Thrift syntax error -
thrift 0.9.2 here. here simple led.thrift
file:
namespace c_glib com.example.led namespace java com.example.led typedef i32 int enum ledstate { off = 0, on = 1 } struct ledtogglecommand { 1: required int ledid; 2: required ledstate state; } exception ledunavailableexception { 1: message; 2: cause; } service ledservice { oneway void toggle(1: ledtogglecommand cmd) throws (1: ledunavailableexception luex); }
when run thrift --gen java led.thrift
following error:
[error:/users/myuser/tmp/thrift_samples/samples/led.thrift:17] (last token ';') syntax error [failure:/users/myuser/tmp/thrift_samples/samples/led.thrift:17] parser error during include pass.
what's going on here?
you need add data types.
exception ledunavailableexception { 1: string message; 2: string cause; }
additionally, (at least) newer versions tell ...
[failure:test.thrift:22] oneway methods can't throw exceptions.
Comments
Post a Comment