Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10393

Crashes when the URL to download is not found on the server

    XMLWordPrintableJSON

Details

    Description

      I am using cordova-plugin-file-transfer plugin in a cordova app to download a static file from a remote server. It works fine in normal cases. But when the server is down, the app crashes. I found the following logs if I debug it in Xcode:

      2016-01-20 21:32:26.972 Kuai[2031:908675] -[CDVFileTransfer download:] [Line 417] File Transfer downloading file...
      2016-01-20 21:32:26.978 Kuai[2031:908736] FileTransferError {
          body = "";
          code = 3;
          "http_status" = 0;
          source = "file:///var/mobile/Containers/Data/Application/AADA2EB9-2DCA-44DD-A588-BD7E7B1B5B81/Documents/www/index.html";
          target = "file:///var/mobile/Containers/Data/Application/AADA2EB9-2DCA-44DD-A588-BD7E7B1B5B81/Documents/www/index.html";
      }
      2016-01-20 21:32:26.978 Kuai[2031:908736] File Transfer Error: The requested URL was not found on this server.
      2016-01-20 21:32:27.033 Kuai[2031:908675] THREAD WARNING: ['Notification'] took '17.649902' ms. Plugin should use a background thread.
      2016-01-20 21:32:27.038 Kuai[2031:908675] -[__NSDictionaryI length]: unrecognized selector sent to instance 0x1402ebdb0
      2016-01-20 21:32:27.039 Kuai[2031:908675] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI length]: unrecognized selector sent to instance 0x1402ebdb0'
      

      The error callback is not invoked.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ybian Ying Bian
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: