[Scilab-Dev] Scilab catching all errors

Serge Steer Serge.Steer at inria.fr
Fri Apr 19 14:09:42 CEST 2013


Syntax errors cannot be caught. but you can use execstr to detect them 
this way:

if execstr(["sciargs(";"disp(5)"],"errcatch")<>0 then
      [error_message,error_number]=lasterror(%t);
      disp(error_message)
end


Serge Steer
Le 18/04/2013 13:19, pratham920 a écrit :
> I am executing a scilab file (containing functions) from python 
> script. I have written the sciab code in try catch block, and the 
> errors are redirected to a file. It catches errors like undefined 
> variable, invalid argument. But error 2 i.e. invalid factor( for 
> eg:*sciargs(* ) is not caught. I want to get that error message as 
> well. Please find the uploaded file. Thank you. Prathameshtest.sce 
> <http://mailinglists.scilab.org/file/n4026567/test.sce>
> ------------------------------------------------------------------------
> View this message in context: Scilab catching all errors 
> <http://mailinglists.scilab.org/Scilab-catching-all-errors-tp4026567.html>
> Sent from the Scilab developers - Mailing Lists Archives mailing list 
> archive 
> <http://mailinglists.scilab.org/Scilab-developers-Mailing-Lists-Archives-f2574944.html> 
> at Nabble.com.
>
>
> _______________________________________________
> dev mailing list
> dev at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20130419/1e197be9/attachment.htm>


More information about the dev mailing list