Thursday, March 21, 2013

JSErrorStackTrace

Javier Soto’s JSErrorStackTrace is a “category on NSError that stores the stack trace of the creation of the NSError object for later retrieval” (via Romain Briche). It’s very useful to have this attached to an error object. He swizzles the initializer and gets the stack trace using -[NSThread callStackSymbols]. That method wasn’t available when I wrote my code, which adds stack frames to the error’s user info as it’s propagated.

Comments RSS · Twitter

Leave a Comment