The stacktrace you are seeing is that raised by executing Assert#fail.
It is not your original Exception.

1) You should probably not be catching Throwable. Catch the explicit
checked exception thrown by m_TheGame#load()

2) If you want your original Exception to get propagated wrap it in a
RuntimeException, ie
  throw new RuntimeException(caughtExcetion);

3) You shouldn't be using junit.framework.Assert#fail in production
code. It should only be using from a test harness.

William

On Jul 29, 12:14 am, Leigh McRae <leigh.mc...@lonedwarfgames.com>
wrote:
> Hello,
>
> I am finding the Android Market crash reports to be an unbelievably
> useful tool!  Unfortunately I am having issues with exceptions that
> happen off the main thread.  Since I am a C programmer, I dropped an
> assert down to get the game to stop.  Clearly I am not a Java expert.
> Is there some way I can get the stack trace of the offending thread?
>
> m_LoadThread = new Thread( new Runnable()
> {
>     public void run()
>     {
>         try
>         {
>             m_TheGame.load();
>         }
>         catch( Throwable t )
>         {
>             t.printStackTrace();
>             junit.framework.Assert.fail( "LoadingMode.LoadThread: " +
> t.toString() );
>         }
>     }
>
> } );
>
> m_LoadThread.start();
>
> This is what I get in the report.  It's better than nothing but more
> would be good.
>
> junit.framework.AssertionFailedError: LoadingMode.LoadThread:
> java.lang.NullPointerException
>   at junit.framework.Assert.fail(Assert.java:47)
>   at com.lonedwarfgames.tanks.utils.Assert.RIP(Assert.java:82)
>   at com.lonedwarfgames.tanks.modes.LoadingMode$1.run(LoadingMode.java:
> 93)
>   at java.lang.Thread.run(Thread.java:1096)

-- 
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

Reply via email to