[wingide-users] Python or maybe a Wing IDE question.

Chris Curvey chris at chriscurvey.com
Mon Jul 23 19:32:24 MDT 2012


On Mon, Jul 23, 2012 at 8:22 PM, Joe Goldthwaite <joe at goldthwaites.com> wrote:
> Hi Everyone,
>
> I'm trying to debug a django application and am running into a problem on
> this segment;
>
> try:
>     request.session['user_obj']
>     return HttpResponseRedirect('/myprofile/')
> except Exception as ex:
>     pass
>
> The IDE is blowing up on the requst.session['user_obj'] line.  Since that
> line in a try/except clause, shouldn't it just fall through instead of going
> into the debugger?
>
> One of two things is happening.  Either the clause "except Exception as ex:"
> isn't trapping a key error or Wing is aborting on all errors even if it's
> handled in the code.
>
> The only reason I suspect the second is that many years ago when I was using
> Wing, I remember there was a setting that controlled whether or not the
> debugger was invoked on handled errors.  I couldn't find any setting in Wing
> 4.1.7-1.  I thought that except Exception would trap any runtime error.  I
> could be wrong on that though.
>
> Any advice?

I think the setting you are looking for is in
Edit->Preferences->Debugger/Exceptions.  At the top there is a
drop-down for "Report Exceptions".  My default is set to "when
printed".  (But I don't know what the right setting would be.)

I'd never seen the "except Exception as ex" syntax.  I'd always used
"except Exception, e:"  I guess I learned something today!

>
> Joe Goldthwaite.
>
>
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide



-- 
e-Mail is the equivalent of a postcard written in pencil.  This
message may not have been sent by me, or intended for you.  It may
have been read or even modified while in transit.  e-Mail disclaimers
have the same force in law as a note passed in study hall.  If your
corporate attorney says that you need an disclaimer in your signature,
you need a new corporate attorney.


More information about the wingide-users mailing list