More detailed error handling