Skip to content

Commit

Permalink
feat: throw exception if sdk would be re-initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
wzieba committed Jan 23, 2024
1 parent 96d3fe9 commit 1ddfda1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.parsely.parselyandroid

public class ParselyAlreadyInitializedException() :
Exception("Parse.ly SDK has been already initialized. Reinitialization is not supported.")
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ public object ParselyTracker {
dryRun: Boolean = false,
) {
if (instance != null) {
Logging.log("Parse.ly SDK has been already initialized. Reinitialization is not supported.")
return
throw ParselyAlreadyInitializedException()
}
instance = ParselyTrackerInternal(siteId, flushInterval, context, dryRun)
}
Expand Down

0 comments on commit 1ddfda1

Please sign in to comment.