<LocalJumpError: return from proc-closure> in WebDialog
-
Google search found a two-year old thread near this topic, which helped me work around a Ruby bug. This post is for the next victim of this bug.
With smaller models, this code, in an action callback, worked:
# update some stuff return if msg.nil? # msg == a callback argument handle the msgWith a large model, it failed, showing the title error. This solved the problem:
# update some stuff unless msg.nil? handle the msg end -
Interesting... Glad the model helped then. Wonder what caused it...?
-
I don't know the finer details yet, but
returning from a proc causes the error.You also get similar errors if you try to
returnvalues from command validation procs.This causes an error.
def my_validation_proc if Sketchup.active_model.selection.nitems == 1 return MF_ENABLED else return MF_GRAYED end endThis does not
def my_validation_proc if Sketchup.active_model.selection.nitems == 1 MF_ENABLED else MF_GRAYED end end -
Rather odd, isn't it, as return is implied in Ruby... no?
-
Maybe, but I don't understand it myself. Rather than returning from the proc, the proc itself evaluates, and that is what is returned.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement