Closed VincentNewkirk closed 5 years ago
Using the --file-per-type option and given this IDL:
--file-per-type
exception DonatelloException { 1: string message } exception DruidException { 1: string message } service DruidQueryService { QueryResult adhocQuery( 2: required string serviceGroup, ) throws ( 1: DonatelloException donatelloException, 2: DruidException druidException, ),
Produces this:
}).catch((err: Error): void => { if (err instanceof DonatelloException) { const result: AdhocQueryResult = new AdhocQueryResult({ donatelloException: err }); output.writeMessageBegin("adhocQuery", thrift.Thrift.MessageType.REPLY, requestId); result.write(output); output.writeMessageEnd(); output.flush(); return; } else if (err instanceof DruidException) { const result: AdhocQueryResult = new AdhocQueryResult({ druidException: err }); output.writeMessageBegin("adhocQuery", thrift.Thrift.MessageType.REPLY, requestId); result.write(output); output.writeMessageEnd(); output.flush(); return; }
The problem is that DonatelloException and DruidException are both undefined. This problem is solves by appending __NAMESPACE__. to both these exceptions.
DonatelloException
DruidException
__NAMESPACE__.
DonatelloException -> __NAMESPACE__.DonatelloExcption
Fixed in 3.4.1
3.4.1
Using the
--file-per-type
option and given this IDL:Produces this:
The problem is that
DonatelloException
andDruidException
are both undefined. This problem is solves by appending__NAMESPACE__.
to both these exceptions.