Made nested class to access all the good stuff in EndpointWriter, especially publishError().