-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Comments
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. |
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.
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.
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.
The label |
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!
The text was updated successfully, but these errors were encountered: