Adding a check to make sure an Error object was not passed into the function.