Leanplum / Leanplum-Android-SDK

Leanplum's integrated solution delivers meaningful engagement across messaging and the in-app experience.
https://www.leanplum.com
Apache License 2.0
46 stars 40 forks source link

Fix Util.handleException to rethrow exceptions during unit testing. #401

Closed hborisoff closed 4 years ago

hborisoff commented 4 years ago
What Where/Who
People Involved @hborisoff

Background

There is a lot of source code that is surrounded by try-catch block and the uncaught exceptions are passed to Util.handleException. This could hide potential issues when running the unit tests because there are a lot of cases where a callback is set in the SDK and an assert statement is executed in the callback, but that assertion exception is handled in Util.handleException and never thrown again and the test is false positive.

To fix that I've introduced two methods:

Also fixed several tests that started failing.