0

Integrated Instabug with my swift 2.3 application, but seen the error reporting api of Instabug accepting NSException as following,

Instabug.reportException(e)

But in swift 2.3, I am getting NSError instance within catch block.

do {

}
catch let error as NSError {

}

I want to report the error I am getting in my catch block to Instabug. Please let me know how I can do this.

Asdrubal
  • 2,421
  • 4
  • 29
  • 37

1 Answers1

1

The reportException method is meant to be used with NSException objects, not NSError.

I believe you might be confusing how try/catch blocks work in Swift versus in other languages like Obj-C. try/catch in Swift should be used to handle recoverable errors, while it's used in Obj-C to handle unrecoverable errors.

Hesham
  • 5,294
  • 3
  • 34
  • 48