return error on truncated write