title: NSURLErrorDomain Code=-2000 "can’t load from network"
body: <p>My app started accidentally with an error that I never had before and I can't find any solution around the net. I think it has nothing to do with my code but if it helps, here it is:</p>
  
  <pre><code>class InterfaceController: WKInterfaceController {
  
  @IBOutlet var tableView: WKInterfaceTable!
  
  final let url = URL(string: "http://...")
  private var tasks = [Task]()
  
  override func awake(withContext context: Any?) {
      super.awake(withContext: context)
  
      downloadJson()
  
  }
  
  func downloadJson() {
      guard let downloadURL = url else { return }
      URLSession.shared.dataTask(with: downloadURL) { data, urlResponse, error in
  
          guard let data = data, error == nil, urlResponse != nil else {
              print("something is wrong")
              return
          }
  
          do
          {
              let decoder = JSONDecoder()
              let downloadedTasks = try decoder.decode(Tasks.self, from: data)
              self.tasks = downloadedTasks.tasks
              print(self.tasks)
  
          } catch {
              print("somehting went wrong after downloading")
          }
  
          }.resume()
  }
  
  }
  </code></pre>
  
  <p>The error message I'm getting in the console is:</p>
  
  <pre><code>2018-11-07 21:34:15.538369+0100 BJwatch WatchKit Extension[1884:84116] Task &lt;82BE34C9-CCAB-4076-8012-CC9FF61AE556&gt;.&lt;1&gt; load failed with error Error Domain=NSURLErrorDomain Code=-2000 "can’t load from network" UserInfo={NSLocalizedDescription=can’t load from network, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask &lt;82BE34C9-CCAB-4076-8012-CC9FF61AE556&gt;.&lt;1&gt;, _NSURLErrorRelatedURLSessionTaskErrorKey=(
  "LocalDataTask &lt;82BE34C9-CCAB-4076-8012-CC9FF61AE556&gt;.&lt;1&gt;"
  ), NSErrorFailingURLStringKey=http://..., _kCFNetworkErrorConditionalRequestKey=&lt;CFMutableURLRequest 0x7c09bc70 [0x34f528c]&gt; {url = http://..., cs = 0x0}, _kCFNetworkErrorCachedResponseKey=&lt;CFCachedURLResponse 0x7afc2840 [0x34f528c]&gt;, NSUnderlyingError=0x7c1eb930 {Error Domain=kCFErrorDomainCFNetwork Code=-2000 "(null)" UserInfo={_kCFNetworkErrorCachedResponseKey=&lt;CFCachedURLResponse 0x7afc2840 [0x34f528c]&gt;, _kCFNetworkErrorConditionalRequestKey=&lt;CFMutableURLRequest 0x7c09bc70 [0x34f528c]&gt; {url = http://..., cs = 0x0}}}, NSErrorFailingURLKey=http://...} [-2000]
   [BJwatch_WatchKit_Extension.Task, BJwatch_WatchKit_Extension.Task,     BJwatch_WatchKit_Extension.Task, BJwatch_WatchKit_Extension.Task]
  </code></pre>
  
  <p>The URL is not "http://..." in the real app. It is a URL that gives a JSON array and it is working.</p>