Improved application-level error handling.