Keep all error properties

Make sure all error properties are preserved when converting into an Error object.

cc @squamos