# HG changeset patch # User Ludovic Chabant # Date 1507188110 25200 # Node ID e1b33cbf98746156236d0c3ad7435cda1558db63 # Parent cf4169795f6246134e5ca1d4656438413dcac861 internal: Give better exception messages when splitting URIs. diff -r cf4169795f62 -r e1b33cbf9874 piecrust/uriutil.py --- a/piecrust/uriutil.py Wed Oct 04 21:38:00 2017 -0700 +++ b/piecrust/uriutil.py Thu Oct 05 00:21:50 2017 -0700 @@ -16,7 +16,8 @@ root = app.config.get('site/root') uri_root = uri[:len(root)] if uri_root != root: - raise Exception("URI '%s' is not a full URI." % uri) + raise Exception("URI '%s' is not a full URI, expected root '%s'." % + (uri, root)) uri = uri[len(root):] return uri_root, uri @@ -24,7 +25,8 @@ def split_sub_uri(app, uri): root = app.config.get('site/root') if not uri.startswith(root): - raise Exception("URI '%s' is not a full URI." % uri) + raise Exception("URI '%s' is not a full URI, expected root '%s'." % + (uri, root)) pretty_urls = app.config.get('site/pretty_urls') trailing_slash = app.config.get('site/trailing_slash')