Converts an error into a regular hash.
The error to convert.
A new object that contains all the properties of the error.
Converts an error into a regular hash.