Skip to content

Commit

Permalink
[TIMOB-25955] Support crash analytics refactor (#10190)
Browse files Browse the repository at this point in the history
  • Loading branch information
garymathews committed Nov 20, 2018
1 parent a553322 commit 98fc928
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ public class TiExceptionHandler implements Handler.Callback, KrollExceptionHandl
private static boolean dialogShowing = false;
private static Handler mainHandler;

private static final String ERROR_TITLE = "title";
private static final String ERROR_MESSAGE = "message";
private static final String ERROR_SOURCENAME = "sourceName";
private static final String ERROR_LINE = "line";
private static final String ERROR_LINESOURCE = "lineSource";
private static final String ERROR_LINEOFFSET = "lineOffset";
private static final String ERROR_JS_STACK = "javascriptStack";
private static final String ERROR_JAVA_STACK = "javaStack";
public static final String ERROR_TITLE = "title";
public static final String ERROR_MESSAGE = "message";
public static final String ERROR_SOURCENAME = "sourceName";
public static final String ERROR_LINE = "line";
public static final String ERROR_LINESOURCE = "lineSource";
public static final String ERROR_LINEOFFSET = "lineOffset";
public static final String ERROR_JS_STACK = "javascriptStack";
public static final String ERROR_JAVA_STACK = "javaStack";

private static final String fill(int count)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ extern NSString * const APSDeployTypeProduction;
- (void)sendAppFeatureEvent:(NSString *)eventName
payload:(NSDictionary *)payload;

/**
* Sends a crash event.
* @param payload crash data to send.
*/
- (void)sendAppCrashEvent:(NSDictionary *)payload;

/**
* Enables Analytics with a given app-key and deploy-type.
* @param appKey The APSAnalytics app-key.
Expand Down
2 changes: 0 additions & 2 deletions iphone/TitaniumKit/TitaniumKit/Sources/Kroll/KrollContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ - (void)invoke:(KrollContext *)context
id excm = [KrollObject toID:context value:exception];
[[TiExceptionHandler defaultExceptionHandler] reportScriptError:[TiUtils scriptErrorValue:excm]];
pthread_mutex_unlock(&KrollEntryLock);
@throw excm;
}
pthread_mutex_unlock(&KrollEntryLock);
}
Expand All @@ -538,7 +537,6 @@ - (id)invokeWithResult:(KrollContext *)context
id excm = [KrollObject toID:context value:exception];
[[TiExceptionHandler defaultExceptionHandler] reportScriptError:[TiUtils scriptErrorValue:excm]];
pthread_mutex_unlock(&KrollEntryLock);
@throw excm;
}
pthread_mutex_unlock(&KrollEntryLock);

Expand Down
6 changes: 6 additions & 0 deletions iphone/TitaniumKit/TitaniumKit/Sources/Kroll/KrollMethod.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ JSValueRef KrollCallAsFunction(JSContextRef jsContext, JSObjectRef func, JSObjec
#endif
*exception = [KrollObject toValue:[o context] value:ex];
}
@catch (NSString *ex) {
*exception = [KrollObject toValue:[o context] value:ex];
}
@finally {
[pool release];
pool = nil;
Expand Down Expand Up @@ -119,6 +122,9 @@ JSValueRef KrollCallAsNamedFunction(JSContextRef jsContext, JSObjectRef func, JS
#endif
*exception = [KrollObject toValue:[o context] value:ex];
}
@catch (NSString *ex) {
*exception = [KrollObject toValue:[o context] value:ex];
}
@finally {
[pool release];
pool = nil;
Expand Down

0 comments on commit 98fc928

Please sign in to comment.