Ensure that the emitted error is always an Error instance

I would like to have another pair of eyes here.
Can you think of a better way to solve this?