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

Use of try! should be avoided #25

Closed
tapwork opened this issue Jul 20, 2017 · 1 comment
Closed

Use of try! should be avoided #25

tapwork opened this issue Jul 20, 2017 · 1 comment

Comments

@tapwork
Copy link
Contributor

tapwork commented Jul 20, 2017

During my Unit Tests I had some crashes that are caused by an error during CoreData save

public func save() {
        try! persistentStore.save()
    }

I saw plenty of places in the SynchronizationManager where error handling is ignored / disabled by the usage of try!.
Why don't you properly use do-catch or just try?.
But try! should only be used if you're certain that there is no error thrown

See: #26

@loudmouth
Copy link
Contributor

Fixed in #26

donnywals pushed a commit to donnywals/contentful-persistence.swift that referenced this issue Aug 16, 2024
Update README for better Swift 2.3 instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants