[PATCH 6 of 7] templater: specialize ResourceUnavailable error so that it can be caught
Yuya Nishihara
yuya at tcha.org
Mon Feb 26 09:29:39 EST 2018
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1519530630 -32400
# Sun Feb 25 12:50:30 2018 +0900
# Node ID 02afa73e633146722c187090fd73885fceb552d9
# Parent 35263744d42f5a3c60faec304d044cbee337599d
templater: specialize ResourceUnavailable error so that it can be caught
See the next patch how it will be used.
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -30,6 +30,9 @@ from . import (
util,
)
+class ResourceUnavailable(error.Abort):
+ pass
+
class TemplateNotFound(error.Abort):
pass
@@ -1377,7 +1380,8 @@ class engine(object):
if v is None:
v = self._resources.get(key)
if v is None:
- raise error.Abort(_('template resource not available: %s') % key)
+ raise ResourceUnavailable(_('template resource not available: %s')
+ % key)
return v
def _load(self, t):
More information about the Mercurial-devel
mailing list