hilla
hilla copied to clipboard
Make it easier to debug an empty @Endpoint class
If you e.g. forget to mark your endpoint method as public, then there will not be any generated .ts file for your @Endpoint class. This may lead you towards investigating whether the file is detected at all or whether the whole code generation is somehow not working.
If there would instead be an empty generated .ts file, then it would be easier to pinpoint the source of the problem. It would be even better if the generated file would contain a comment that points out that there aren't any public methods in the Java class.
Another alternative would be that the generator fails with a clear error in this kind of situation.
Hi, just a comment regarding this. It happened to me twice that I had to waste time investigating why the endpoint was not being generated because there were no logs and no ts file generated without methods. I think that just stress that endpoint methods should be public in the documentation is not enough (probably that is why this issue is still opened). IMHO, adding a warning in the logs that no public methods where found while scanning an @Endpoint annotated class would be enough, given that it would make no sense to have it like that.
adding a warning in the logs that no public methods where found
It has occasionally happened that some users have noticed log messages, but I wouldn't count on it. Since there isn't really any reason to have an annotated class without public methods, it could just as well throw an error.
Throwing an error seems good in this case.