handle connection reset errors
add debug message for file reset
refactor watch tasks workflow