Show More
@@ -423,14 +423,17 b' def runfilter(context, mapping, data):' | |||||
423 | thing = unwrapastype(thing, getattr(filt, '_intype', None)) |
|
423 | thing = unwrapastype(thing, getattr(filt, '_intype', None)) | |
424 | return filt(thing) |
|
424 | return filt(thing) | |
425 | except (ValueError, AttributeError, TypeError): |
|
425 | except (ValueError, AttributeError, TypeError): | |
|
426 | raise error.Abort(_formatfiltererror(arg, filt)) | |||
|
427 | except error.ParseError as e: | |||
|
428 | raise error.ParseError(bytes(e), hint=_formatfiltererror(arg, filt)) | |||
|
429 | ||||
|
430 | def _formatfiltererror(arg, filt): | |||
|
431 | fn = pycompat.sysbytes(filt.__name__) | |||
426 |
|
|
432 | sym = findsymbolicname(arg) | |
427 |
|
|
433 | if not sym: | |
428 | msg = (_("template filter '%s' is not compatible with keyword '%s'") |
|
434 | return _("incompatible use of template filter '%s'") % fn | |
429 | % (pycompat.sysbytes(filt.__name__), sym)) |
|
435 | return (_("template filter '%s' is not compatible with keyword '%s'") | |
430 | else: |
|
436 | % (fn, sym)) | |
431 | msg = (_("incompatible use of template filter '%s'") |
|
|||
432 | % pycompat.sysbytes(filt.__name__)) |
|
|||
433 | raise error.Abort(msg) |
|
|||
434 |
|
437 | |||
435 | def runmap(context, mapping, data): |
|
438 | def runmap(context, mapping, data): | |
436 | darg, targ = data |
|
439 | darg, targ = data |
General Comments 0
You need to be logged in to leave comments.
Login now