thatone
6 Mar 2009, 2:01 PM
We encountered a situation where a nefarious NPE in our code was being swallowed.
Took a while to figure out where. What happened was that our NPE was thrown from within the onSuccess code of an RpcProxy whose logic is to catch exceptions and pass them on to callback.onFailure().
This would be fine except that the BaseListLoader's callback.onFailure() simply fires a LoadException. If you are only using the loader with a ListStore, list store's default behaviour is to simply swallow the event:
protected void onLoadException(LoadEvent le) {
}
Code should NEVER swallow exceptions, especially by default. As an API user, i should never have to explicitly wire up a LoadException to make sure exception's are visible.
Took a while to figure out where. What happened was that our NPE was thrown from within the onSuccess code of an RpcProxy whose logic is to catch exceptions and pass them on to callback.onFailure().
This would be fine except that the BaseListLoader's callback.onFailure() simply fires a LoadException. If you are only using the loader with a ListStore, list store's default behaviour is to simply swallow the event:
protected void onLoadException(LoadEvent le) {
}
Code should NEVER swallow exceptions, especially by default. As an API user, i should never have to explicitly wire up a LoadException to make sure exception's are visible.