Converts an error into a regular hash.