changeset 4453:9fdd5ec8bc11

cleanup: be less verbose and less aggressive when catching exceptions
author Mads Kiilerich <madski@unity3d.com>
date Thu, 21 Aug 2014 23:46:55 +0200
parents 4da77b595698
children 9cfc66a665ae
files kallithea/controllers/files.py kallithea/lib/vcs/backends/hg/repository.py
diffstat 2 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/files.py	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/controllers/files.py	Thu Aug 21 23:46:55 2014 +0200
@@ -94,7 +94,6 @@
                     category='warning')
             raise HTTPNotFound()
         except(ChangesetDoesNotExistError, LookupError), e:
-            log.error(traceback.format_exc())
             msg = _('Such revision does not exist for this repository')
             h.flash(msg, category='error')
             raise HTTPNotFound()
@@ -115,7 +114,6 @@
             if file_node.is_dir():
                 raise RepositoryError('given path is a directory')
         except(ChangesetDoesNotExistError,), e:
-            log.error(traceback.format_exc())
             msg = _('Such revision does not exist for this repository')
             h.flash(msg, category='error')
             raise HTTPNotFound()
--- a/kallithea/lib/vcs/backends/hg/repository.py	Thu Aug 21 23:46:55 2014 +0200
+++ b/kallithea/lib/vcs/backends/hg/repository.py	Thu Aug 21 23:46:55 2014 +0200
@@ -463,10 +463,10 @@
         rev_spec = "%%s & %s(%%s)" % _revset_predicates[ref_type]
         try:
             revs = self._repo.revs(rev_spec, ref_name, ref_name)
-        except (LookupError, ):
+        except LookupError:
             msg = ("Ambiguous identifier %s:%s for %s" % (ref_type, ref_name, self.name))
             raise ChangesetDoesNotExistError(msg)
-        except (IndexError, ValueError, RepoLookupError, TypeError):
+        except RepoLookupError:
             msg = ("Revision %s:%s does not exist for %s" % (ref_type, ref_name, self.name))
             raise ChangesetDoesNotExistError(msg)
         if revs: