You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you call a color converter (just an example) which takes a symbol we get a rather weird error message to anyone who is not a JRubyFX hacker:
Exception running Application:
#<TypeError: cannot convert instance of class org.jruby.RubySymbol to class javafx.scene.paint.Paint>
/Users/enebo/work/jrubyfx/lib/jrubyfx/core_ext/precompiled.rb:908:in `fill='
Now we know something went wrong with fill= but this is pretty confusing to new users and we can give better feed back. Here is what I have a patch for (I will commit it as a discussion provoker):
Exception running Application:
#<ArgumentError: No such color: redbull>
/Users/enebo/work/jrubyfx/lib/jrubyfx/utils/common_converters.rb:144:in `CommonConverters'
org/jruby/RubyProc.java:264:in `call'
/Users/enebo/work/jrubyfx/lib/jrubyfx/core_ext/precompiled.rb:908:in `fill='
So the backtrace now shows common converters and the proc call for the converter but the message is likely to be really obvious. It would be possible to make a much more sophisticated coercion mechanism but I feel this is a big improvement for a tiny amount of work.
The text was updated successfully, but these errors were encountered:
c6e37b2 is a commit which enables this behavior for color converter. We can revert this if we decide we dislike it but I hate seeing the RubySymbol stuff. I think we should add this to all symbol-based converters since a symbol is always an invalid type to pass to a FX method.
I played a little with a more robust mechanism to converters to report at he proper place but without a lot of codegen I don't see a nice way of doing it.
When you call a color converter (just an example) which takes a symbol we get a rather weird error message to anyone who is not a JRubyFX hacker:
Now we know something went wrong with fill= but this is pretty confusing to new users and we can give better feed back. Here is what I have a patch for (I will commit it as a discussion provoker):
So the backtrace now shows common converters and the proc call for the converter but the message is likely to be really obvious. It would be possible to make a much more sophisticated coercion mechanism but I feel this is a big improvement for a tiny amount of work.
The text was updated successfully, but these errors were encountered: