It's easy to get the thrift exceptions wrong, given the following thrift: ``` thrift service Wat { WatResponse wat( 1: required WatRequest request ) throws ( 1: InvalidRequestException invalid 2: NotFoundException notFound ) } ``` I might implement the following endpoint ``` js function wat(context, req, head, body, cb) { cb(null, { ok: false, head: null, body: { message: 'not found' }, typeName: 'NotFoundException' }); } ``` This will confusingly break by returning an empty arg3 body. What should have happened was an exception like: ``` js assert(true, 'Expected typeName to be one of { invalid, notFound }'); ``` cc @kriskowal @breerly
It's easy to get the thrift exceptions wrong, given the following thrift:
I might implement the following endpoint
This will confusingly break by returning an empty arg3 body.
What should have happened was an exception like:
cc @kriskowal @breerly