File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -315,13 +315,17 @@ void leanplumInternalError(NSException *e)
315315 int userCodeBlocks = [[[[NSThread currentThread ] threadDictionary ]
316316 objectForKey: LP_USER_CODE_BLOCKS] intValue ];
317317 if (userCodeBlocks <= 0 ) {
318- [[LeanplumRequest post: LP_METHOD_LOG
319- params: @{
320- LP_PARAM_TYPE: LP_VALUE_SDK_ERROR,
321- LP_PARAM_MESSAGE: [e description ],
322- @" stackTrace" : [[e callStackSymbols ] description ] ?: @" " ,
323- LP_PARAM_VERSION_NAME: versionName
324- }] send ];
318+ @try {
319+ [[LeanplumRequest post: LP_METHOD_LOG
320+ params: @{
321+ LP_PARAM_TYPE: LP_VALUE_SDK_ERROR,
322+ LP_PARAM_MESSAGE: [e description ],
323+ @" stackTrace" : [[e callStackSymbols ] description ] ?: @" " ,
324+ LP_PARAM_VERSION_NAME: versionName
325+ }] send ];
326+ } @catch (NSException *e) {
327+ // This empty try/catch is needed to prevent crash <-> loop.
328+ }
325329 NSLog (@" Leanplum: INTERNAL ERROR: %@ \n %@ " , e, [e callStackSymbols ]);
326330 } else {
327331 NSLog (@" Leanplum: Caught exception in callback code: %@ \n %@ " , e, [e callStackSymbols ]);
Original file line number Diff line number Diff line change @@ -160,17 +160,15 @@ - (void)runQuery:(NSString *)query bindObjects:(NSArray *)objectsToBind
160160 }
161161
162162 @synchronized (self) {
163- sqlite3_stmt *statement = [ self sqliteStatementFromQuery: query bindObjects: objectsToBind];
164- if (! statement) {
165- return ;
166- }
167-
168- int result = sqlite3_step (statement);
169- if (result != SQLITE_DONE) {
170- [ self handleSQLiteError: @" SQLite fail to run query " errorResult: result query: query];
163+ @try {
164+ sqlite3_stmt * statement = [ self sqliteStatementFromQuery: query bindObjects: objectsToBind];
165+ if (!statement) {
166+ return ;
167+ }
168+ } @catch ( NSException *e) {
169+ LPLog (LPError, @" SQLite operation failed. " );
170+ // TODO: Make sure to catch this when new logging is in place,
171171 }
172- willSendErrorLog = NO ;
173- sqlite3_finalize (statement);
174172 }
175173}
176174
You can’t perform that action at this time.
0 commit comments