ํต์ฌ๋ก
recordHandledException:(NSException* __nonnull)exception withAttributes:(NSDictionary* __nullable)attributes;
์ฒ๋ฆฌ๋ ์์ธ๋ฅผ ๊ธฐ๋กํฉ๋๋ค. ์ ํ์ ์ผ๋ก ์ปจํ ์คํธ๋ฅผ ํ์ํ๋ ์ถ๊ฐ ์์ฑ์ด ์๋ ๋งต์ ๊ฐ์ ธ์ต๋๋ค.
์๊ตฌ ์ฌํญ
์์ด์ ํธ ๋ฒ์ 5.15.0 ์ด์ .
์ค๋ช
recordHandledException
API๋ ์ถฉ๋ ๋ถ์์ ์ ์ฉํฉ๋๋ค. ์บก์ฒ๋ ์ด๋ฒคํธ๋ ์ ํ๋ฆฌ์ผ์ด์
์์ ์์ธ๊ฐ ๋ฐ์ํ๋ ๋น๋์ ์กฐ๊ฑด์ ์ดํดํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค. ์ฐ๊ฒฐ๋ ์ฌ์ฉ์ ์ ์ ์์ฑ ์ธ์๋ ์ด๋ฒคํธ์๋ ์ฐ๊ฒฐ๋ ์ธ์
์์ฑ ๋ ์์ต๋๋ค.
์ด API๋ NSException
๋ฐ ์ ํ์ NSDictionary
์์ฑ ์ฌ์ ์ ์ธ์คํด์ค๋ฅผ ๊ฐ์ ธ์จ ๋ค์ recordHandledException
์ด๋ฒคํธ๋ฅผ ์์ฑํฉ๋๋ค. ์ถฉ๋ ์ด๋ฒคํธ ์ถ์ UI ์์ ์ด๋ฒคํธ ๋ฐ์ดํฐ๋ฅผ ๋ณด๊ณ NRQL์ ์ฌ์ฉํ์ฌ ์ฟผ๋ฆฌํ ์ ์์ต๋๋ค.
์ด API๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์ปจํ ์คํธ๋ ์ฌ์ฉ์ ์ ์ ์์ฑ ๋ฐ ์ด๋ฒคํธ ์ ์ก์ ๋ํ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์ญ์์ค.
์ค์
์ด ๊ธฐ๋ฅ์ Swift ์ฝ๋์ ํจ๊ป ์ฌ์ฉํ๋ฉด ์ ๋ฉ๋๋ค. Swift ์ฝ๋์์ ์ฒ๋ฆฌ๋ ์ค๋ฅ๋ฅผ ์ถ์ ํ๋ ค๋ฉด recordError๋ฅผ ์ฌ์ฉํ์ธ์.
๋งค๊ฐ๋ณ์
๋งค๊ฐ๋ณ์ | ์ค๋ช |
---|---|
NSException | ํ์์. throw๋ ์์ธ ๊ฐ์ฒด์ ๋๋ค. |
NSDictionary | ์ ํ ๊ณผ๋ชฉ. ์ปจํ ์คํธ๋ฅผ ์ ๊ณตํ๋ ์์ฑ ์ฌ์ . |
์
์ค๋ธ์ ํฐ๋ธ-C
๋ฐฉ๋ฒ:
+ (void) recordHandledException:(NSException* __nonnull)exception withAttributes:(NSDictionary* __nullable)attributes;
+ (void) recordHandledException:(NSException* __nonnull)exception;
์:
๊ฐ๋จํ Objective-C ์:
@try { @throw [NSException exceptionWithName:@"versionException" reason:@"App version no longer supported" userInfo:nil]; } @catch (NSException* e) { [NewRelic recordHandledException:e]; }
์ฌ์ ์ด ์๋ Objective-C ์:
NSException *exception = [NSException exceptionWithName:@"MyException" reason:@"I have my reason" userInfo:nil]; NSDictionary* dictionary = @{@"int": @1, @"Test Group" : @"A | B"}; [NewRelic recordHandledException:exception withAttributes:dictionary];