add network error handle
Merge pull request #1922 from matiu/check/net

add network error handle