-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TIMOB-10707] iOS: Expose runtime errors to module developers
- Loading branch information
Max Stepanov
committed
Sep 14, 2012
1 parent
03b109c
commit a72fc22
Showing
6 changed files
with
269 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#pragma mark - TiScriptError | ||
|
||
/** | ||
* Script Error class | ||
*/ | ||
@interface TiScriptError : NSObject | ||
|
||
/** | ||
* Returns source URL where error happenned. | ||
*/ | ||
@property (nonatomic, readonly) NSString *sourceURL; | ||
|
||
/** | ||
* Returns line number where error happenned. | ||
*/ | ||
@property (nonatomic, readonly) NSInteger lineNo; | ||
|
||
/** | ||
* Returns error related message | ||
*/ | ||
@property (nonatomic, readonly) NSString *message; | ||
|
||
- (id)initWithMessage:(NSString *)message sourceURL:(NSString *)sourceURL lineNo:(NSInteger)lineNo; | ||
- (id)initWithDictionary:(NSDictionary *)dictionary; | ||
|
||
@end | ||
|
||
#pragma mark - TiExceptionHandlerDelegate | ||
|
||
/** | ||
* Exception handler delegate protocol. | ||
*/ | ||
@protocol TiExceptionHandlerDelegate <NSObject> | ||
|
||
/** | ||
* Called when Objective-C exception is thrown. | ||
* @param exception An original NSException object | ||
* @param stackTrace An array of strings containing stack trace description | ||
*/ | ||
- (void)handleUncaughtException:(NSException *)exception withStackTrace:(NSArray *)stackTrace; | ||
- (void)handleScriptError:(TiScriptError *)error; | ||
|
||
@end | ||
|
||
#pragma mark - TiExceptionHandler | ||
|
||
/** | ||
* The Exception Handler class. Singleton instance accessed via <defaultExceptionHandler> | ||
*/ | ||
@interface TiExceptionHandler : NSObject < TiExceptionHandlerDelegate > | ||
|
||
/** | ||
* Delegate for error/exception handling | ||
* @see TiExceptionHandlerDelegate | ||
*/ | ||
@property (nonatomic, assign) id<TiExceptionHandlerDelegate> delegate; | ||
|
||
/** | ||
* Presents provided script error to user. Default behavior in development mode. | ||
* @param error The script error object/ | ||
*/ | ||
- (void)showScriptError:(TiScriptError *)error; | ||
|
||
/** | ||
* Returns singleton instance of TiExceptionHandler. | ||
* @return singleton instance | ||
*/ | ||
+ (TiExceptionHandler *)defaultExceptionHandler; | ||
|
||
- (void)reportScriptError:(TiScriptError *)error; | ||
|
||
@end | ||
|
Oops, something went wrong.
a72fc22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since that commit i get [TiUtils exceptionMessage:]: unrecognized selector sent to class ...