Detect the error that may happen when downloading a file