sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Update | Sketchucation Tools 5.0.8 released with licensing improvements and bugfixes Download

    Make OSX WebDialog alert of script errors?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 299 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • thomthomT
      thomthom
      last edited by

      I find that when an error happen in an OSX WebDialog the messages are silently eaten. Is there a way to make it pop up an alert, like under Windows IE?

      Thomas Thomassen — SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply
      Reply Quote 0
      • thomthomT
        thomthom
        last edited by

        No window.onerror for Safari it appears. Googling and checking stackoverflow.

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply
        Reply Quote 0
        • A
          Aerilius
          last edited by

          In internet explorer we can redirect popup errors to the Ruby Console, so I guess Safari would also trigger the onerror handler?

          window.onerror = function(errorMsg, url, lineNumber){ 
            Dialog.callRuby("puts", errorMsg, url, lineNumber); // or whatever callback...
            return true; // This prevents tells the browser the error needs no further handling (no popup).
          }
          
          1 Reply Last reply
          Reply Quote 0
          • thomthomT
            thomthom
            last edited by

            Maybe this can work: http://extechops.net/2011/07/04/generic-onerror/

            ?

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply
            Reply Quote 0
            • D
              driven
              last edited by

              error alerts like this work

              wwhdlg = UI;;WebDialog.new("wot_works_here", true, "wwh", 739, 641, 50, 50, true);
               wwhdlg.set_url "http://www.eborcom.com/webmaker/tutorials/rhoque/ex2_5.html"
               wwhdlg.show_modal 
               wwhdlg.navigation_buttons_enabled=true
              

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply
              Reply Quote 0
              • Dan RathbunD
                Dan Rathbun
                last edited by

                The MSDN page says there are no standards that apply to onerror (its IE only.)

                You could it on both the document and window objects just to be sure.

                If Safari is DOM Level 3, then you may need to use:
                %(#8000BF)[window.addEventListener("error",*fHandlerName*,*bCapture*)]
                [window.addEventListener](http://msdn.microsoft.com/en-us/library/ff975245(v)
                DOM Level 3: Error
                Example:
                http://msdn.microsoft.com/en-us/library/hh772306(v=vs.85).aspx

                Or you could %(#8000BF)[catch] the errors with JS:
                [url=http://msdn.microsoft.com/en-us/library/4yahc5d8(v=vs.85).aspx:3cyk4r6q]try ... catch ... finally[/url:3cyk4r6q]
                [url=http://msdn.microsoft.com/en-us/library/85fscz6h(v=vs.85).aspx:3cyk4r6q]throw[/url:3cyk4r6q]
                [url=http://msdn.microsoft.com/en-us/library/dww52sbt(v=vs.85).aspx:3cyk4r6q]Error object[/url:3cyk4r6q]

                I'm not here much anymore.

                1 Reply Last reply
                Reply Quote 0

                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 Login
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement