Use custom error types for Query error handling.