improve error messaging in UrlUtil