Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrooge-sbt-plugin should complain if exception identifiers are not unique #288

Open
reikje opened this issue Feb 19, 2018 · 0 comments
Open

Comments

@reikje
Copy link

reikje commented Feb 19, 2018

When you define a service function that throws multiple exceptions, but you use the same exception identifier/name, scrooge-sbt-plugin should already fail to generate code.

Expected behavior

The generate step should fail with a similar error that the vanilla thrift generator produces: "2: e" - field identifier/name has already been used.

Actual behavior

Code is generated but doesn't compile, so the user is left to figure out why. If the generate task would fail due to invalid syntax, you would immediately see what the problem is.

Steps to reproduce the behavior

Use the following thrift definition:

exception ArgumentInvalidException {
    1: string message
}

exception ServiceException {
    1: string message
}

service SomeService {
    string foo(1: string name)
        throws (1: ServiceException e, 2: ArgumentInvalidException e)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant