projects
/
zzz-spline-gts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
30d693c
)
If the parse of an uploaded Pokémon fails, don't catch the crash.
author
Eevee
<git@veekun.com>
Sun, 15 Aug 2010 04:16:08 +0000
(21:16 -0700)
committer
Eevee
<git@veekun.com>
Sun, 15 Aug 2010 04:16:08 +0000
(21:16 -0700)
splinext/gts/controllers/gts.py
patch
|
blob
|
history
diff --git
a/splinext/gts/controllers/gts.py
b/splinext/gts/controllers/gts.py
index
15b3457
..
1349c16
100644
(file)
--- a/
splinext/gts/controllers/gts.py
+++ b/
splinext/gts/controllers/gts.py
@@
-19,6
+19,7
@@
from sqlalchemy import and_, or_, not_
from sqlalchemy.orm import aliased, contains_eager, eagerload, eagerload_all, join
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql import func
from sqlalchemy.orm import aliased, contains_eager, eagerload, eagerload_all, join
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql import func
+from sqlalchemy.exc import IntegrityError
from spline.model import meta
from spline.lib.base import BaseController, render
from spline.model import meta
from spline.lib.base import BaseController, render
@@
-196,9
+197,9
@@
class GTSController(BaseController):
meta.Session.add(stored_pokemon)
meta.Session.commit()
return '\x01\x00'
meta.Session.add(stored_pokemon)
meta.Session.commit()
return '\x01\x00'
- except:
- # If that failed
(presumably due to unique key collision), we're
- #
already storing
something. Reject!
+ except
IntegrityError
:
+ # If that failed
due to unique key collision, we're already storing
+ # something. Reject!
return '\x0c\x00'
def page_post_finish(self, pid, data):
return '\x0c\x00'
def page_post_finish(self, pid, data):