Skip to content

Consistent error and exception reporting (PFParameterAssert usage) #6

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

Closed
moflo opened this issue Aug 13, 2015 · 2 comments
Closed

Consistent error and exception reporting (PFParameterAssert usage) #6

moflo opened this issue Aug 13, 2015 · 2 comments

Comments

@moflo
Copy link

moflo commented Aug 13, 2015

Hi, thank you for opening this code base up & good work! We occasionally get stuck with runtime exceptions which are difficult to debug. Having centralized error and exception mechanism should help, but your code currently uses a mix of PFParameterAssert macros, NSAssertions and ad-hoc error reporting. Could you perhaps use PFParameterAssert throughout so we have a central point to trap all exceptions?

For example, these calls to NSAssertion could be converted to the PFParameterAssert (or similar) macro: https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/search?utf8=✓&q=NSException&type=Code

Finally, any chance we could see the error codes in PFConstants aligned with the error & exception reporting: https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/blob/61f68e9333206f0eebf15d5adab076a0ae7c4b71/Parse/PFConstants.h#L151

Thanks!

@nlutsenko
Copy link
Contributor

It's a great point!

The thing with asserts vs errors is that asserts are meant to be a very early indication of a programmer mistake vs something that could go wrong along the line (no network connection or server settings changed).

We are consistently iterating over to convert low-signal asserts (exceptions) to errors, but it's going to take a little bit of time to get there. Would be great to get some feedback on specific assertions that are not useful and having an error instead would be more helpful.

@nlutsenko nlutsenko self-assigned this Aug 13, 2015
richardjrossiii added a commit that referenced this issue Aug 21, 2015
We no longer do `@throw [NSException exceptionWith...]` anywhere in the code base, replaced usages of `if (conditon) [NSException raise:...` with PFParamter/ConsistencyAssert where appropriate.

This is related to #6.
richardjrossiii added a commit that referenced this issue Aug 21, 2015
We no longer do `@throw [NSException exceptionWith...]` anywhere in the code base, replaced usages of `if (conditon) [NSException raise:...` with PFParamter/ConsistencyAssert where appropriate.

This is related to #6.
richardjrossiii added a commit that referenced this issue Aug 25, 2015
We no longer do `@throw [NSException exceptionWith...]` anywhere in the code base, replaced usages of `if (conditon) [NSException raise:...` with PFParamter/ConsistencyAssert where appropriate.

This is related to #6.
@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:improvement labels Dec 6, 2021
@parse-github-assistant
Copy link

The label type:feature cannot be used in combination with type:improvement.

@parse-github-assistant parse-github-assistant bot removed the type:feature New feature or improvement of existing feature label Dec 6, 2021
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

3 participants