Hello What would be the best way to return server error in try, except to user
I have multiple functions and i have try, except in each and I would like to show user in alert what the error was (only for selected functions) my except is except Exception as e: script.update_record(sc_status = 10) exc_type, exc_obj, exc_tb = sys.exc_info() fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1] errmsg = [exc_type, fname, exc_tb.tb_lineno,e.__doc__ , e.message] print "errmsg ", errmsg print(exc_type, fname, exc_tb.tb_lineno) print e.__doc__ print e.message return dict(status = 666, errmsg = errmsg) any suggestions -- 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. For more options, visit https://groups.google.com/d/optout.