Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors Thrown from here are not handled #112

Open
shaqaruden opened this issue Sep 22, 2015 · 3 comments
Open

Errors Thrown from here are not handled #112

shaqaruden opened this issue Sep 22, 2015 · 3 comments

Comments

@shaqaruden
Copy link

I'm trying to use DDMathParser in its simplest form of the copy and pasting the code provided in the Wiki and i get the error that is in the title of this issue for this code.

let value = try "1 + 2".evaluate()

Im using Xcode 7 with Swift 2 and installed DDMathParser with CocoaPods.

@davedelong
Copy link
Owner

As mentioned on the Errors wiki page, you need to perform this within a do ... catch block.

I'll leave this open as a request to expand the wiki article on how to effectively deal with errors.

@kanjizu
Copy link

kanjizu commented Dec 4, 2015

but where the right way example? i create a new blank project anh write the first example code is
let value = try "1 + 2".evaluate()
and get this error? please help for begining useer! Thank you so much!

@shaqaruden
Copy link
Author

@kanjizu Im not sure why he is not putting fully working code in the Documentation but here is what you need to do.

do {
    let value = try "1 + 2".evaluate() 
} catch {
    print(error)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants