AndEngine icon indicating copy to clipboard operation
AndEngine copied to clipboard

More explicit onManaged* Exceptions

Open flomin opened this issue 11 years ago • 0 comments

Exceptions can occurred in the onManagedDraw or onManagedUpdate methods of Entity and onUpdateSpriteBatch method of SpriteBatch:

  • IndexOutOfBound if a detach was done on the UI Thread;
  • NPE if an attach is done with a null value...

These exceptions can be pretty tough to track and correct.

This patch display more informations about the exact entity which can problem by adding try/catch blocks to these methods and wrapping the exception with context information.

It also does a NPE check in the Entity.toString(StringBuilder) method, as well as using getName instead of getSimpleName to have useful informations when using proguard.

flomin avatar Apr 11 '13 09:04 flomin