Skip to content

Not able to catch exception in Xcode 9.4 and swift 4 #18

@raj-qt

Description

@raj-qt

Hi,
I am using the code to handle swift exception but unfortunately its not woking.

Here is the code i am trying.

var array = [String] ();
SwiftTryCatch.try({
var val = array[40]
}, catch: { (error) in
// code to handle exception
print("in catch")
}, finallyRun: {
// code to do any way
print("in finally")
})

Its just crashing on line var val = array[40] and not catch the exception in catch clause

Can anyone help me please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions