parse-community / Parse-Swift

The Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, Linux, Android, Windows)
https://parseplatform.org
MIT License
308 stars 69 forks source link

fix: some async/await methods won't throw errors #334

Closed cbaker6 closed 2 years ago

cbaker6 commented 2 years ago

New Pull Request Checklist

Issue Description

Async/await methods that have void returns won't throw errors received from the server; particularly delete(), logout(), ParseUser.verif...(), and ParseAnalytics methods. They would on throw http errors.

In addition, some places in the code still force unwrap or can be done with less code.

Related issue: #n/a

Approach

The the returned value of async/await void methods and throw errors if needed.

Remove force unwrapping and clean up code.

TODOs before merging

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #334 (7584949) into main (d2de796) will increase coverage by 0.06%. The diff coverage is 78.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #334      +/-   ##
==========================================
+ Coverage   85.06%   85.13%   +0.06%     
==========================================
  Files         114      114              
  Lines       12188    12208      +20     
==========================================
+ Hits        10368    10393      +25     
+ Misses       1820     1815       -5     
Impacted Files Coverage Δ
Sources/ParseSwift/Objects/ParseInstallation.swift 82.49% <0.00%> (+0.13%) :arrow_up:
Sources/ParseSwift/Objects/ParseUser.swift 83.18% <42.85%> (+0.27%) :arrow_up:
...ources/ParseSwift/Types/ParseAnalytics+async.swift 90.00% <75.00%> (-10.00%) :arrow_down:
...s/ParseSwift/Objects/ParseInstallation+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseObject+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseUser+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Types/ParseFile+async.swift 100.00% <100.00%> (ø)
Sources/ParseSwift/Objects/ParseObject.swift 82.74% <0.00%> (+0.45%) :arrow_up:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d2de796...7584949. Read the comment docs.