Skip to content

4.5.14.2 - new API for method handlers return values

Choose a tag to compare

@guss77 guss77 released this 09 May 11:48
· 191 commits to master since this release

Introducing a new API to allow method handlers to offload the sending of responses and reporting of errors to Irked, with minimal effort.

This feature update just adds handling for method handlers return values. A method could always be declared to return a value, it was just ignored. With this new feature, if the method returns a Future instance, Irked will wrap it with Request.sendOrFail(), or if the method returns any other value (including null) Irked will use Request.send() to send the result. Handling of methods throwing exceptions has not changed and this is still a valid way to report errors.

See the TestMethodController unit test for example usage.