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

Capture error object in error callback in a string and not a CaptureErrorCB object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0, 1.2.0
    • 1.3.0
    • cordova-android
    • Samsung Galaxy S2

    Description

      While using the Capture API, specifically to capture video, the returned object within the the error callback is a string with value "Canceled." and not a CaptureErrorCB with an error code.
      This happens when the user cancels the capture using the back button, but could also happen for other error (with another message).

      This is the code in question :

      else if (resultCode == Activity.RESULT_CANCELED) {
      // If we have partial results send them back to the user
      if (results.length() > 0)

      { this.success(new PluginResult(PluginResult.Status.OK, results, "navigator.device.capture._castMediaFile"), this.callbackId); }
      // user canceled the action
      else { this.fail("Canceled."); }
      }
      // If something else
      else {
      // If we have partial results send them back to the user
      if (results.length() > 0) { this.success(new PluginResult(PluginResult.Status.OK, results, "navigator.device.capture._castMediaFile"), this.callbackId); }

      // something bad happened
      else

      { this.fail("Did not complete!"); }

      }
      }

      Attachments

        Activity

          People

            macdonst Simon MacDonald
            paradoxpixel Daniel Adrian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: