From 2cbec70983d2d2c20b239877562d682ffd7d5fe5 Mon Sep 17 00:00:00 2001 From: Eevee Date: Sat, 14 Aug 2010 21:16:08 -0700 Subject: [PATCH] =?utf8?q?If=20the=20parse=20of=20an=20uploaded=20Pok?= =?utf8?q?=C3=A9mon=20fails,=20don't=20catch=20the=20crash.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- splinext/gts/controllers/gts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/splinext/gts/controllers/gts.py b/splinext/gts/controllers/gts.py index 15b3457..1349c16 100644 --- 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.exc import IntegrityError 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' - 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): -- 2.7.4