child is sometimes an instance of Error, in which case it cannot be appended directly to the DOM. Prevent an exception by appending the error as a string