Skip to content

Commit

Permalink
2.1.3 PR feedback: throw AssertionError instead of RuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Li committed Jan 22, 2016
1 parent a844992 commit 4b7de01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# 2016-01-20 - 2.1.3
# 2016-01-22 - 2.1.3

#### Bug Fixed and Improvements

* If apps upgrading from pre-2.0.0 still has now obsolete NetworkStateReceiver defined in their manifest, an immediate run-time exception will help them detect early.
* Message Center now has different layout on tablet
* If apps upgrading from pre-2.0.0 still has now obsolete NetworkStateReceiver defined in their manifest, an immediate run-time assertion error will help app developers detect early.

# 2016-01-08 - 2.1.2

Expand Down
9 changes: 3 additions & 6 deletions apptentive/src/com/apptentive/android/sdk/Apptentive.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ public static void onStart(Activity activity) {
}
runningActivities++;
MessageManager.setCurrentForgroundActivity(activity);
} catch (RuntimeException e) {
throw e;
}
catch (Exception e) {
} catch (Exception e) {
Log.w("Error starting Apptentive Activity.", e);
MetricModule.sendError(activity.getApplicationContext(), e, null, null);
}
Expand Down Expand Up @@ -1033,9 +1030,9 @@ private static void init(Activity activity) {
ActivityInfo[] registered = packageInfo.receivers;
if (registered != null) {
for (ActivityInfo activityInfo : registered) {
// Throw immediate runtime exception when relict class found in manifest.
// Throw assertion error when relict class found in manifest.
if (activityInfo.name.equals("com.apptentive.android.sdk.comm.NetworkStateReceiver")) {
throw new RuntimeException("NetworkStateReceiver has been removed from Apptentive SDK, please make sure it's also removed from manifest file");
throw new AssertionError("NetworkStateReceiver has been removed from Apptentive SDK, please make sure it's also removed from manifest file");
}
}
}
Expand Down

0 comments on commit 4b7de01

Please sign in to comment.