> The alternative is for web2py to catch all possible exceptions. > Massimo, how would you want to handle that?
Yes, web2py it should catch all possible exceptions. If you a patch send it to me or I will eventually write one. Massimo On Oct 30, 11:01 am, Timothy Farrell <[EMAIL PROTECTED]> wrote: > What's happening is some database modules are not good Python citizens. > By this, I mean that they raise exceptions that don't inherit from > Python's Exception class. web2py only catches Exceptions. In the event > of an non-Exception exception web2py's behavior is undefined. I built a > wrapper class for my db2 network access and as part of my wrapper, I > caught the special exceptions and raised more web2py friendly Exceptions. > > The alternative is for web2py to catch all possible exceptions. > Massimo, how would you want to handle that? > > -tim > > [EMAIL PROTECTED] wrote: > > web2py users, > > > I'm using pyodbc, unixodbc and freetds to hit an MSSQL database. > > > When I attempt to do a: > > > a_sample_inventory = db(db.smp_inventory.smp_id == > > request.vars.smp_id).select() > > a_sample_inventory[0].update_record(status="present") > > > I get: > > > Traceback (most recent call last): > > File "/home/larsenma/web2py/gluon/restricted.py", line 62, in > > restricted > > File "/usr/share/web2py/applications/hpv/controllers/home.py", line > > 45, in <module> > > File "/home/larsenma/web2py/gluon/globals.py", line 55, in <lambda> > > File "/usr/share/web2py/applications/hpv/controllers/home.py", line > > 40, in unreserve > > db(a_sample_history[0]).delete() > > File "/usr/share/web2py/gluon/sql.py", line 1110, in delete > > self._db._execute(query) > > File "/usr/share/web2py/gluon/sql.py", line 448, in <lambda> > > self._execute=lambda *a,**b: self._cursor.execute(*a,**b) > > ProgrammingError: ('42000', "[42000] [FreeTDS][SQL Server]Incorrect > > syntax near '<'. (102) (SQLExecDirectW)") > > > I looked at the generated sql statement and it looks fine. > > And ideas what's going on? > > > Thanks. > > > > tfarrell.vcf > < 1KViewDownload --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---