Skip to content

Commit 840a058

Browse files
Add description for NSException
1 parent 6e7c973 commit 840a058

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

AppBox/Common/Extensions/NSException+Description.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
1212

1313
@interface NSException (Description)
1414

15+
-(NSString *)abDescription;
16+
1517
@end
1618

1719
NS_ASSUME_NONNULL_END

AppBox/Common/Extensions/NSException+Description.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010

1111
@implementation NSException (Description)
1212

13+
-(NSString *)abDescription {
14+
return [NSString stringWithFormat:@"\n\nName: %@\nReason: %@\nUserInfo: %@", self.name, self.reason, self.userInfo];
15+
}
16+
1317
@end

0 commit comments

Comments
 (0)