2.22.5-stable+timestamp.2022.06.04.18.13.51
(Running on Microsoft-IIS/10.0, Python 3.9.13)

I am trying to catch errors in web2py shell scripts which are run in batch, 
but some exceptions are not being passed up the call stack when running in 
shell mode.

My situation is as follows:

   1. Create the error scenario
      1. empty the languages/plural-en.py in the welcome application
   2. Run a shell script using -M -R 
      1. can be a simple Hello World script
   3. Since it is a shell script, shell.py is used instead of main.py
   4. The exception will be triggered in gluon/languages.py in in the 
   function read_plural_dict_aux() when executing 
      1. return eval(lang_text) or {}
   5. In this scenario, the shell script will fail but give a success 
   return code (rc=0) because the exception is not passed up the call stack
   6. If the welcome application is run via the browser, it uses main.py 
   instead of shell.py and the exception is passed up the call stack and we 
   can see the error code in the error ticket.  

I have tried catching the exception from a few different places and tried 
custom extensions as well, but I can't catch this exception anywhere in the 
call stack.

The reason I am trying to solve this is that we have batch jobs that 
sometimes have failed but give a success return code and so I am trying to 
find the root cause.  I think that this failure to capture the exceptions 
may be the cause.  Does anyone have any ideas as to what could be the 
reason for this? 

Note: If you want to see the call stack, it suffices to delete all the 
contents of plural-en.py and run the welcome app from the browser.  In the 
error ticket, the call stack will basically the same as the shell version 
as of the call to compileapp.py

Kind Regards,
David

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a3de01b6-336a-44bd-ab79-ec47af07f382n%40googlegroups.com.

Reply via email to