Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

exceptions are not exposed on Services/Functions #28

Open
blampe opened this issue Sep 23, 2015 · 5 comments
Open

exceptions are not exposed on Services/Functions #28

blampe opened this issue Sep 23, 2015 · 5 comments

Comments

@blampe
Copy link
Contributor

blampe commented Sep 23, 2015

exception Foo {}

service Bar {
    string baz(
     ) throws (
         1: Foo err,
     );
}

I'd expect to be able to reference service.Bar.Foo or service.Bar.baz.Foo.

cc @kriskowal

@Torwegia
Copy link

This is also true for structs or anything else defined outside of the service definition. It leads to service.module.X which is unfortunate.

@kriskowal
Copy link

For cross-reference, in ThriftRW-node you get:

  • thrift.Foo
  • thrift.Bar
  • thrift.Bar.baz.Arguments
  • thrift.Bar.baz.Result

And the expectation is to carry the thrift object around.

@kriskowal
Copy link

…of course, with ThriftRW-node, you can duck-type all these with plain old objects so nobody knows about this structure yet.

@abhinav
Copy link
Contributor

abhinav commented Oct 7, 2015

With thriftrw, service is a module which exports all the types and and service.Bar is just a simple object that exposes objects representing the service methods.

I guess it'll be easier for people coming from Apache Thrift if we re-exported all types as attributes in service.Bar (re-exporting just the things used by the service is probably more book-keeping than it's worth).

@blampe
Copy link
Contributor Author

blampe commented Oct 7, 2015

I would make migration a little easier. Also we could eventually do smart things, like not allow service.Bar.SomeException if Bar doesn't declare SomeException as something it throws.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants