Is there a script mode to get the position of the line where an error occurs?

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
pietro_72_
Full Member
Posts: 81
Joined: Fri Apr 17, 2015 6:40 am
Location: http://creativitainformaticart.altervista.org

Is there a script mode to get the position of the line where an error occurs?

Post by pietro_72_ » Sat Aug 26, 2017 6:22 pm

Hello

Is there a script mode to get the position of the line where an error occurs?

With this code:
    try {
        .........
        .........
    }
    Catch (e) {
      EAction.handleUserMessage ( "");
      EAction.handleUserMessage ("Error Start Tracking");
      EAction.handleUserMessage (e.name);
      EAction.handleUserMessage (e.Message);
      EAction.handleUserMessage ("Error:" + e);
      EAction.handleUserMessage (e.fileName);
      EAction.handleUserMessage ("Fine tracing error");
      EAction.handleUserMessage ( "");
      }
        .........
        .........
   
I've been able to get these results:
        .........
        .........
     
     Error starting tracking
     TypeError
     Result of expression 'this.data3D [id] [numVertex]' [undefined] is not an object.
     Error: TypeError: Result of expression 'this.data3D [id] [numVertex]' [undefined] is not an object.
     scripts / Misc / MiscDraw / OrthogonalProjections / OrthogonalProjections.js
     Fine tracing error

        .........
        .........


But I did not find any kind of property ...... (e.lineNumber); Returning the line number, is there some way?

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”