non descriptive error

Ron Adam rrr at ronadam.com
Sun Oct 9 19:52:12 EDT 2005


Timothy Smith wrote:
> i have reproduced the error in this code block
> 
> #save values in edit
>         self.FinaliseTill.SaveEditControlValue()
>         if 
> Decimal(self.parent.TillDetails[self.TillSelection.GetStringSelection()]['ChangeTinBalance'])) 
> == Decimal('0'):
>             #box must be checked before continuing
>             if self.PlacedInSafe.GetValue() != 1:
>                 self.parent.Popup("You must place the till draw back in 
> the safe","Till draw")
>             else:
>                 #finalise the till draw
>                 if     Decimal(self.TillFloat.GetLabel().split('$')[1]) 
> != Decimal('0'):
>                     Prompt = wx.MessageDialog(self,"""The correct amount 
> has not been returned from the till draw float to the main float!
>                     If you proceed please contact your 
> manager""","Change tin doesn't balance!",wx.YES_NO)
>                     if Prompt.ShowModal() == wx.ID_YES:
>                         self.Submit()
>         else:
>             self.parent.Popup('You have an outstanding change tin 
> balance on this till','Change tin')
> 
> 
> i have NO idea what in there could be making it have such a strange 
> error. it just says "error" when you try run it. there nothing terribly 
> strange being done.

Look for two possibilities.  There is most likely a bare try-except in 
either one of these functions or methods, *OR* in one of the functions 
or methods that calls this bit of code.

To try and pin it down further, introduce and error in here along with a 
print statement right before it, and see what happens.  The print lets 
you know your error was actually executed. If you get the same error, 
then the bare except is in a routine that calls this one but the actual 
error is at a later point.  If you get a new error, then they are both 
after that point.  Keep moving your indicator pair till you find the 
try-except that is giving you the errror.  Once you find the try-except 
pair that has intercepted the error, you can insert a bare raise right 
after the except and see the actual python error is.  That should give 
you a better idea of what's going on.

Cheers,
    Ron






More information about the Python-list mailing list