question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong exception type thrown in GWT backend ReflectionCache.forName

See original GitHub issue

Documentation for reflect.ClassReflection.forName states that it throws ReflectionException and does so in native java implementation https://github.com/libgdx/libgdx/blob/0acff984c84cf7a8765603865dadbe7ba987c8cd/gdx/src/com/badlogic/gdx/utils/reflect/ClassReflection.java#L29-L31 However, the GWT implementation throws a RuntimeException https://github.com/libgdx/libgdx/blob/0acff984c84cf7a8765603865dadbe7ba987c8cd/backends/gdx-backends-gwt/src/com/badlogic/gwtref/client/ReflectionCache.java#L49-L51

This is an inconsistency and GWTs implementation should follow the doc.

This can probably be fixed by gwt reflection cache throwing a ClassNotFoundException, which would get caught by https://github.com/libgdx/libgdx/blob/0acff984c84cf7a8765603865dadbe7ba987c8cd/backends/gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/emu/com/badlogic/gdx/utils/reflect/ClassReflection.java#L30-L34

Please select the affected platforms

  • Android
  • iOS
  • HTML/GWT
  • Windows
  • Linux
  • macOS

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gnojuscommented, Dec 7, 2021

I can, PR incoming sometime then.

0reactions
MrStahlfelgecommented, Dec 6, 2021

This should be an easy change, do you want to file a PR @nojus297

Read more comments on GitHub >

github_iconTop Results From Across the Web

GWT Catching exception thrown by HttpServlet - Stack Overflow
The Development Mode view in Eclipse reports an error of type "uncaught exception", which suggests that I'm really doing a bad job at...
Read more >
GWT Reflection unknown error · Issue #3724 · libgdx ... - GitHub
Getting a type, which is not in the cache, for a field an javascript exception in GWT rather than returning null or maybe...
Read more >
Exception handling in GWT Service - Google Groups
and i want to catch this exception in the client side and perform actions. But i get the following error from GWT: [ERROR]...
Read more >
7 Tips for Exception Handling in GWT - Ben Northrop
1. Handle all uncaught client-side exceptions · 2. Unravel GWT's UmbrellaException · 3. Log exceptions on the client · 4. Log exceptions on...
Read more >
Exception Handling in Java (with Real Examples) - Sentry Blog
An illegal argument exception is thrown when input to a method is of the wrong type; for example, an array is passed when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found