Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add support for NSError and NSException reporting #15011

Closed

Description

@julianrex

Add support for reporting internal NSErrors and NSExceptions generated by the iOS SDK.

This is now possible since -[MMEEventsManager reportError:] and -[MMEEventsManager reportException:] were added in #14868 by @alfwatt.

For example, this will allow us to report if #14232 (the iOS 12.2 hang) occurs in iOS 13+.

Activity

  1. added
    iOS
    on Jun 26, 2019
  2. added this to the release-p milestone on Jun 26, 2019
  3. changed the title [-]Add support for error and exception reporting[/-] [+]Add support for NSError and NSException reporting[/+] on Jun 26, 2019
  4. added
    telemetry
    on Jun 26, 2019
  5. m-stephen commented on Jul 31, 2019

    @m-stephen
    Contributor

    Sorry for updating this ticket late.
    I'm trying to make a function like this for instead of using [NSException raise: format:] directly in our SDK:

    void MGLRaiseException(NSString *name, NSString *reason, NSDictionary *userInfo) {
        NSException *exception = [NSException exceptionWithName:name reason:reason userInfo:userInfo];
        [[MMEEventsManager sharedManager] reportException:exception];
        [exception raise];
    }
    

    However, after I re-check the -[MMEEventsManager reportException:], this function is not
    a realtime reporting(they are pushed into an event queue and some triggers can flush to server) but most of exception in our SDK is realtime raised.
    So there is a problem that, if we use this function to report these events, the exception should not be raised, otherwise we may lost most of events since these events are not wrote in disk. But I think it's necessary to throw exception, which let developers know what&where the bug is.

    So shall we make a real-time reporting or write these event into disk? Or we just ignore those raised exceptions and only collect some try-catch block ones? @alfwatt @julianrex

  6. alfwatt commented on Aug 1, 2019

    @alfwatt
    Contributor

    @m-stephen we don't have a way to flag an event as 'real time' or 'send immediately' right no, and I don't think we should start throwing exceptions unless there's a real programmer error. Better to use NSError objects and reportError:

  7. julianrex commented on Sep 10, 2019

    @julianrex
    ContributorAuthor

    @alfwatt will this be solved when we have deferred telemetry? It sounds like, even if we do, we'll need a way to flush the in-memory events to disk, before raising the exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

iOStelemetry

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions