templater: specialize ResourceUnavailable error so that it can be caught
See the next patch how it will be used.
--- a/mercurial/templater.py Sun Feb 25 12:47:53 2018 +0900
+++ b/mercurial/templater.py Sun Feb 25 12:50:30 2018 +0900
@@ -30,6 +30,9 @@
util,
)
+class ResourceUnavailable(error.Abort):
+ pass
+
class TemplateNotFound(error.Abort):
pass
@@ -1377,7 +1380,8 @@
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):