Just throw a new IOException... Thanks, Justin Anderson MagouyaWare Developer http://sites.google.com/site/magouyaware
On Wed, May 23, 2012 at 9:26 AM, Francisco M. Marzoa Alonso < fmmar...@gmail.com> wrote: > Hi there, > > Just for debugging my code I rather like to simulate the case an > exception is raised, and I do not know how to do it. > > The code is the following: > > try { > AssetFileDescriptor assetDescriptor = assets.openFd(filename); > return new AndroidMusic(assetDescriptor); > } catch (IOException e) { > throw new RuntimeException("Couldn't load music '" + > filename + "'"); > } > > What I want to do is to force the IOException after > > AssetFileDescriptor assetDescriptor = assets.openFd(filename); > > So the code goes into the catch block. > > How could I do that? > > Thanks a lot in advance, > > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en