Re: Exception not being caught in try statement

2021-05-12 Thread Mark Allan via Cocoa-dev
Hi all, Thanks to everyone for their suggestions. I spent far too much time working around this bug, but have finally got to the bottom of the original issue. It turns out this is a known issue with some other apps as well, and (thanks to https://trac.cyberduck.io/ticket/11231#comment:25

Re: Exception not being caught in try statement

2021-03-29 Thread Martin Wierschin via Cocoa-dev
Breaking the RTFD loading process down into subtasks is a good idea. It might be worth trying to sidestep the issue using NSAttributedString. You can try loading the data yourself as Mike suggested and then use initWithRTFD or initWithRTFDFileWrapper. Once you have the text in an attributed stri

Re: Exception not being caught in try statement

2021-03-28 Thread Gabriel Zachmann via Cocoa-dev
I can't really answer your questions ... but just a dumb suggestion: have you tried removing all tabs from your RTF file? Best regards, Gabriel >> >> Any ideas what's going on? Other than the file not being found, why else >> might the object at line 3 in the backtrace be nil...and more inter

Re: Exception not being caught in try statement

2021-03-27 Thread Stephane Sudre via Cocoa-dev
It's trying to insert a NSTextTab * object. On Fri, Mar 26, 2021 at 12:11 PM Mark Allan via Cocoa-dev wrote: > > Hi folks, > > Some users are reporting a crash that I can't reproduce, and in an attempt to > gain additional diagnostics from a user, I wrapped the affected line in a > try/catch b

Re: Exception not being caught in try statement

2021-03-26 Thread Mike Abdullah via Cocoa-dev
This does seem quite surprising. However, here’s the thing: this code is very strange approach to take. Number 1: Cocoa doesn’t support exceptions as an error-handling mechanism except where explicitly stated and supported. You’re trying to use them, which is asking for trouble. The system does

Re: Exception not being caught in try statement

2021-03-26 Thread Rob Petrovec via Cocoa-dev
Don’t forget to include a sample app that demonstrates the problem. —Rob > On Mar 26, 2021, at 12:02 PM, Gary L. Wade via Cocoa-dev > wrote: > > Try surrounding the call with beginEditing and endEditing on the text > storage. If it still happens, submit a feedback to Apple with the full cra

Re: Exception not being caught in try statement

2021-03-26 Thread Gary L. Wade via Cocoa-dev
Try surrounding the call with beginEditing and endEditing on the text storage. If it still happens, submit a feedback to Apple with the full crash log. -- Gary L. Wade http://www.garywade.com/ > On Mar 26, 2021, at 4:11 AM, Mark Allan via Cocoa-dev > wrote: > > Hi folks, > > Some users are r

Re: Error reporting in Cocoa (was Re: Exception not being caught)

2011-03-22 Thread Kyle Sluder
On Tue, Mar 22, 2011 at 8:07 AM, A.M. wrote: > I am curious as to how you would propose to add error: handlers to DO calls > considering that DO is meant to transparent and cannot modify method > signatures. For example, assuming you were designing a new DO framework, how > would you propose ch

Re: Error reporting in Cocoa (was Re: Exception not being caught)

2011-03-22 Thread A.M.
On Mar 21, 2011, at 10:24 PM, Chris Hanson wrote: > Ultimately, the solution will be to modify HessianKit -- or any other > framework that presents an RPC-style interface[1] -- to follow the Cocoa > convention of returning BOOL (or a non-nil/nil object reference) to indicate > success or failu

Re: Error reporting in Cocoa (was Re: Exception not being caught)

2011-03-21 Thread Rick Mann
On Mar 21, 2011, at 7:24 PM, Chris Hanson wrote: > The reason is that if your exception crosses any stack frame you don’t fully > control, all bets are off when it comes to the state of your program. The > frameworks have all been written with the assumption that exceptions are only > for cat

Error reporting in Cocoa (was Re: Exception not being caught)

2011-03-21 Thread Chris Hanson
On Mar 21, 2011, at 2:19 PM, Rick Mann wrote: >> You can't currently throw an exception across a forwarded call. When the >> exception unwinder hits the forwarding frame, it stops and the exception >> goes uncaught. You'll need to put your exception handler at a different >> level. > > Hrm. Th

Re: Exception not being caught

2011-03-21 Thread Steve Steinitz
Hi Johnathan On 21/03/11, Rick Mann & Jonathan Mitchell wrote: My NSOperation subclass wraps the call to the network code in a @try/catch block. But when this exception is raised, the app terminates due to an uncaught exception. Exceptions on the main thread of a Cocoa application do not typ

Re: Exception not being caught

2011-03-21 Thread Greg Parker
On Mar 21, 2011, at 2:43 PM, Laurent Daudelin wrote: > On Mar 21, 2011, at 14:19, Greg Parker wrote: >> (The problem is that the forwarding machinery is hand-written assembly, and >> nobody added hand-written exception unwind tables to match. With "zero-cost" >> exceptions, the unwinder cannot pr

Re: Exception not being caught

2011-03-21 Thread Laurent Daudelin
On Mar 21, 2011, at 14:19, Greg Parker wrote: > (The problem is that the forwarding machinery is hand-written assembly, and > nobody added hand-written exception unwind tables to match. With "zero-cost" > exceptions, the unwinder cannot process a frame without its unwind tables.) Hand-written a

Re: Exception not being caught

2011-03-21 Thread Rick Mann
On Mar 21, 2011, at 2:19 PM, Greg Parker wrote: > On Mar 21, 2011, at 2:06 PM, Kyle Sluder wrote: >> On Mon, Mar 21, 2011 at 2:03 PM, Greg Parker wrote: >>> You can't currently throw an exception across a forwarded call. When the >>> exception unwinder hits the forwarding frame, it stops and th

Re: Exception not being caught

2011-03-21 Thread Rick Mann
On Mar 21, 2011, at 2:03 PM, Greg Parker wrote: > On Mar 20, 2011, at 9:11 PM, Rick Mann wrote: >> On Mar 20, 2011, at 12:45 PM, jonat...@mugginsoft.com wrote: >>> On 20 Mar 2011, at 19:17, Rick Mann wrote: I have some code, called from a subclass of NSOperation, that throws an excepti

Re: Exception not being caught

2011-03-21 Thread Greg Parker
On Mar 21, 2011, at 2:06 PM, Kyle Sluder wrote: > On Mon, Mar 21, 2011 at 2:03 PM, Greg Parker wrote: >> You can't currently throw an exception across a forwarded call. When the >> exception unwinder hits the forwarding frame, it stops and the exception >> goes uncaught. You'll need to put your

Re: Exception not being caught

2011-03-21 Thread Kyle Sluder
On Mon, Mar 21, 2011 at 2:03 PM, Greg Parker wrote: > You can't currently throw an exception across a forwarded call. When the > exception unwinder hits the forwarding frame, it stops and the exception goes > uncaught. You'll need to put your exception handler at a different level. Does this li

Re: Exception not being caught

2011-03-21 Thread Rick Mann
On Mar 21, 2011, at 2:03 PM, Greg Parker wrote: > On Mar 20, 2011, at 9:11 PM, Rick Mann wrote: >> On Mar 20, 2011, at 12:45 PM, jonat...@mugginsoft.com wrote: >>> On 20 Mar 2011, at 19:17, Rick Mann wrote: I have some code, called from a subclass of NSOperation, that throws an excepti

Re: Exception not being caught

2011-03-21 Thread Greg Parker
On Mar 20, 2011, at 9:11 PM, Rick Mann wrote: > On Mar 20, 2011, at 12:45 PM, jonat...@mugginsoft.com wrote: >> On 20 Mar 2011, at 19:17, Rick Mann wrote: >>> I have some code, called from a subclass of NSOperation, that throws an >>> exception pretty reliably if I put a breakpoint elsewhere in th

Re: Exception not being caught

2011-03-21 Thread Rick Mann
On Mar 21, 2011, at 2:50 AM, jonat...@mugginsoft.com wrote: > As you are raising the exception then you could try raising the exception > experimentally when the operation starts to help source the problem. > You mentioned break points earlier. What happens when the code runs outside > of the d

Re: Exception not being caught

2011-03-21 Thread jonat...@mugginsoft.com
On 21 Mar 2011, at 04:11, Rick Mann wrote: >> Can you give us the exception report? >> Is it an NSException instance? > > Yes. It is raised by this line of code: > >[NSException raise:NSInvalidArchiveOperationException format:@"Network > error domain:%@ code:%d", [requestError domain], [re

Re: Exception not being caught

2011-03-20 Thread Rick Mann
On Mar 20, 2011, at 12:45 PM, jonat...@mugginsoft.com wrote: > > > On 20 Mar 2011, at 19:17, Rick Mann wrote: > >> I have some code, called from a subclass of NSOperation, that throws an >> exception pretty reliably if I put a breakpoint elsewhere in the code (it is >> code that does an HTTP

Re: Exception not being caught

2011-03-20 Thread jonat...@mugginsoft.com
On 20 Mar 2011, at 19:17, Rick Mann wrote: > I have some code, called from a subclass of NSOperation, that throws an > exception pretty reliably if I put a breakpoint elsewhere in the code (it is > code that does an HTTP request, and it's getting a broken pipe, and raising > an exception to r