Structured and unstructured error handling