Re: collectException range violation

2013-02-20 Thread cal
On Wednesday, 20 February 2013 at 07:54:19 UTC, monarch_dodra wrote: Note that an Error is not an Exception, and an Exception is not an Error. Both, however, are Throwable's. If you want to catch an *anything*, then catch a Throwable. As already mentioned though, catching an Error is not somet

Re: collectException range violation

2013-02-19 Thread monarch_dodra
On Wednesday, 20 February 2013 at 01:32:10 UTC, cal wrote: On Wednesday, 20 February 2013 at 01:19:54 UTC, Ali Çehreli wrote: The example is wrong. a[4] throws an Error (not Exception) but collectException catches Exception by default. Additionally, the example is doing something that is reco

Re: collectException range violation

2013-02-19 Thread cal
On Wednesday, 20 February 2013 at 01:19:54 UTC, Ali Çehreli wrote: The example is wrong. a[4] throws an Error (not Exception) but collectException catches Exception by default. Additionally, the example is doing something that is recommended against: Catching Error or a descendent of it. Sti

Re: collectException range violation

2013-02-19 Thread Ali Çehreli
On 02/19/2013 04:38 PM, cal wrote: > Is this example from the docs still meant to work? > > int[] a = new int[3]; > int b; > assert(collectException(a[4], b)); The example is wrong. a[4] throws an Error (not Exception) but collectException catches Exception by default. Additionally, the exampl