WAS 7.0 wsadmin jython 2.1 datasource testConnection not catching exception properly

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

WAS 7.0 wsadmin jython 2.1 datasource testConnection not catching exception properly

Bob Gibson

    Additionally, this statement is wrong!

    ----------------------------------------------------------------------
    typ,val,tb = sys.exc_info()[1]
    ----------------------------------------------------------------------

    because the [1] is only returning 1 value, not 3.  If you really
    want all 3 values, remove the [1]

    ----------------------------------------------------------------------
    typ,val,tb = sys.exc_info()
    ----------------------------------------------------------------------

      In my experience, I have never used the traceback to resolve the
    issue.  So I tend to use this expression instead:

    ----------------------------------------------------------------------
    Type, value = sys.exc_info()[ :2 ]
    print 'Error: %s\nvalue: %s' % ( str( Type ), str( value )
    ----------------------------------------------------------------------

    Bob


------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users