From c64d98d16e4952eb8175118e664a58c5eeb90137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Terr=C3=B3n?= Date: Thu, 4 Sep 2014 16:33:11 +0200 Subject: [PATCH] Use a different message when AstrometryNetTimeoutExpired is emitted --- astrometry.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/astrometry.py b/astrometry.py index 11b6751..2a63f1c 100644 --- a/astrometry.py +++ b/astrometry.py @@ -376,8 +376,16 @@ def main(arguments = None): try: output_path = astrometry_net(img.path, **kwargs) - except AstrometryNetUnsolvedField: - msg = "%s did not solve. Ignored." % img.path + + except AstrometryNetUnsolvedField, e: + + # A subclass of AstrometryNetUnsolvedField + if isinstance(e, AstrometryNetTimeoutExpired): + msg = "%s exceeded the timeout limit. Ignored." + else: + msg = "%s did not solve. Ignored." + + msg %= img.path print style.prefix + msg warnings.warn(msg, RuntimeWarning) continue