Issue #10: Improve error reporting