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

ref: json serialization error reporting #2355

Merged
merged 6 commits into from
Nov 14, 2022

Commits on Nov 3, 2022

  1. Configuration menu
    Copy the full SHA
    3fe877a View commit details
    Browse the repository at this point in the history
  2. ref: json serialization error handling

    before:
        - test if input is valid JSON with `-[NSJSONSerialization
        isValidJSON]` and if not, build our own error.
        - problem: no hints as to why the JSON is invalid
    
    after:
        - attempt direct serialization with `-[NSJSONSerialization
        dataWithJSONObject:options:error:]` and use the library error
        - this can throw an exception in certain failure modes: surround
        the call with try/catch
        - use new functions in SentryError to create an NSError from
        either an NSException or the inout NSError
        - only compile like this for nonrelease builds so we don't incur
        the performance hit of throwing an exception (see apple's docs:
        "For best performance in 64-bit, you should throw exceptions only
        when absolutely necessary.")
    armcknight committed Nov 3, 2022
    Configuration menu
    Copy the full SHA
    45cdc11 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b959c35 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dd01a3e View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2022

  1. add tests

    armcknight committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    a9e0435 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2022

  1. Configuration menu
    Copy the full SHA
    d9bcb31 View commit details
    Browse the repository at this point in the history