sure, I still don't like the fact that we need to throw an exception that we caught one level deeper.
@Edison: can we change the internal api to throw the exception? On Fri, Apr 11, 2014 at 12:47 PM, Alex Hitchins <a...@alexhitchins.com> wrote: > OK, so that should be > > if(snapshotInfoReturn==null){ > throw new ResourceAllocationException("Take snapshot for VolumeId: > " > + volumeId + " failed.", ResourceType.snapshot); > } > > So I get null - I should raise an exception. > > Alex Hitchins | 07788 423 969 | 01892 523 587 > --------------------------------------------- > > -----Original Message----- > From: Daan Hoogland [mailto:daan.hoogl...@gmail.com] > Sent: 11 April 2014 18:33 > To: dev > Cc: Alex Hitchins; Edison Su; Laszlo Hornyak > Subject: Re: Review Request 19616: Added check for null return. > > On Fri, Apr 11, 2014 at 9:50 AM, Alex Hitchins <a...@alexhitchins.com> > wrote: >> >> if(snapshotInfoReturn.equals(null)){ >> throw new ResourceAllocationException("Take snapshot for VolumeId: > " >> + volumeId + " failed.", ResourceType.snapshot); >> } > > > This will never throw a ResourceAllocationException. It will throw a > NullPointerException or pass, as you call a method on an Object to see if it > is null (no object). > > -- > Daan > -- Daan