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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -