Clone Error instances to preserve instances of subclasses of Error

If we're dealing with an instance of a subclass of Error, we can't just make a
new Error, otherwise we lose that class information. Instead, we can clone the
original instance.
cc @templaedhel