Allowed any error object to be passed in as the previous error - allows us to use system generated errors in our error objects
Added check for invalid host