catching my own exception

Jon Clements joncle at googlemail.com
Fri Jun 18 13:36:21 EDT 2010


On 18 June, 18:08, nick <nick-n... at net4u.hr> wrote:
> I have a problem with catching my own exception. Here is the code:http://fly.srk.fer.hr/~nick/travapi/blame.php?repname=Travian+API&pat...
>
> Line 252 calls a method, which on line 207 raises a
> SomethingBeingBuiltError exception. On line 253 I catch that
> exception, but when I run that code, I get:
>
> Traceback (most recent call last):
>   File "village.py", line 252, in <module>
>     v.upgrade_cheapest()
>   File "/media/data/home/code/travapi/village.py", line 207, in upgrade_cheapest
>     raise SomethingBeingBuiltError()
> village.SomethingBeingBuiltError: 'Unable to upgrade, check if something is being built.'
>
> If I change line 253 to only "except:", everything works as
> expected. How come? What am I missing? Any help would be appreciated.
>
> P.S.: I'm aware I'm exposing my login/pass in the code. Don't care
> really, those are throwaway accounts.
>
> --
> "Now the storm has passed over me
> I'm left to drift on a dead calm sea
> And watch her forever through the cracks in the beams
> Nailed across the doorways of the bedrooms of my dreams"

http://www.travian.com/spielregeln.php -- rule 3???



More information about the Python-list mailing list