Set error code to 500 on writer failure callback when the status code is set to 200.