vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
868 stars 58 forks source link

Improve exception message when a DTO field has unsupported type #2431

Open javier-godoy opened 1 month ago

javier-godoy commented 1 month ago

Describe your motivation

Related to https://github.com/vaadin/hilla/issues/83, the exception that is currently thrown when the DTO has a JsonNode field does not clearly indicate what is wrong:

2024-05-15T06:35:23.463-03:00 ERROR 71650 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [com.vaadin.flow.server.ServiceException: java.lang.IllegalStateException: com.vaadin.flow.server.ExecutionFailedException: Failed to run TypeScript endpoint generator] with root cause

com.vaadin.flow.server.ExecutionFailedException: Failed to run TypeScript endpoint generator
at dev.hilla.internal.TaskGenerateEndpointImpl.execute(TaskGenerateEndpointImpl.java:85) ~[engine-runtime-2.5.7.jar:na]
at com.vaadin.flow.server.frontend.NodeTasks.execute(NodeTasks.java:342) ~[flow-server-24.3.7.jar:24.3.7]
at com.vaadin.base.devserver.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:354) ~[vaadin-dev-server-24.3.7.jar:na]
at com.vaadin.base.devserver.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:295) ~[vaadin-dev-server-24.3.7.jar:na]

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

cromoteca commented 1 month ago

Can you provide an example to reproduce the issue and which version of Hilla you are using? Also, https://github.com/vaadin/hilla/pull/2398 has been merged into 24.5 so that JsonNode will be supported starting from that version.