Skip to content

Trying to add extra data on iOS #4

Description

@AntonioCuevaUrraco

So I figured out with the guys of NS how to catch the NS error and the stack trace so I want to add those to the crash on iOS so they are more detailed.

Raygun has this methods for iOS

/**
  Manually send an exception to Raygun with the current state of execution.
  warning backtrace will only be populated if you have caught the exception
 */
- (void)send:(NSException *)exception;

/**
 Manually send an exception to Raygun with the current state of execution and a list of tags.

 @warning backtrace will only be populated if you have caught the exception
 */
- (void)send:(NSException *)exception withTags:(NSArray *)tags;

/**
 Manually send an exception to Raygun with the current state of execution, a list of tags and a dictionary of custom data.

 @warning backtrace will only be populated if you have caught the exception
 */
- (void)send:(NSException *)exception withTags:(NSArray *)tags withUserCustomData:(NSDictionary *)userCustomData;

/**
 Manually send an exception name and reason to Raygun with the current state of execution, a list of tags and a dictionary of custom data.
 */
- (void)send:(NSString *)exceptionName withReason: (NSString *)exceptionReason withTags: (NSArray *)tags withUserCustomData: (NSDictionary *)userCustomData;

/**
 Manually send an error to Raygun with the current state of execution, a list of tags and a dictionary of custom data.
 */
- (void)sendError:(NSError *)error withTags:(NSArray *)tags withUserCustomData:(NSDictionary *)userCustomData;

So I am trying to use them but I always end up on crash with something like -[_NSObserverList UTF8String]: unrecognized selector sent to instance

This is what I tried:

raygun.sendExtraData = function(val) {
    this._checkIfRunning();

    var utils = require("utils/utils");
    var string= NSString.alloc().initWithString("something");

    var dictionary= NSDictionary.dictionaryWithDictionary({
                                                         Key1: '.mp3',
                                                         Key2: 16,
                                                         Key3: 44100,
                                                         Key4: 2,
                                                         });

    var array = utils.ios.collections.jsArrayToNSArray(["string", "string"]);
    var error= NSError.errorWithDomainCodeUserInfo(string, 200, dictionary);

    this._getReporter().sendErrorWithTagsWithUserCustomData(error, array, dictionary);
};

Also I tried some other of the raygun methods to send, to send null instead of the objects and to send "string" instead of creating a NSString

Do you have some idea how to fix this issue? with this on place we could say raygun is a complete crash report tool working on nativescript

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions