Improves error message when URL building fails.