Revert "write error after end対応"

This reverts commit 189ca2c6bdfaf3eab915eab1751ae8ee168ce96c.