Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DIA-3263] The fix of no internet issue: Update to new android SDK version #30

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ public static SpConsents UnwrapSpConsentsAndroid(string json)
}
catch (Exception ex)
{
throw new ApplicationException("An error occurred during JSON unwrapping.", ex);
throw new ApplicationException("An error occurred during JSON unwrapping." + ex.Message, ex);
}
}

private static SpCcpaConsent UnwrapSpCcpaConsentAndroid(CcpaConsentWrapper wrappedCcpa)
{
if (wrappedCcpa == null)
throw new ArgumentNullException(nameof(wrappedCcpa), "The CCPA consent wrapper cannot be null.");
{
CmpDebugUtil.LogError("The CCPA consent wrapper cannot be null.");
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we want to return null instead of throwing an error? I mean, what do we do with the null value after that is being returned from this function? do we do something to handle this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is a part of unparsing process and I don't mind having the object as null since it is a possible outcome for that object with doesn't break the overall flow. Error handling exists above level in the call tree. The logging is enough for now. Since throwing error triggers entire unparsing process to throw.

}
CcpaConsent unwrapped = new CcpaConsent(
uuid: wrappedCcpa.uuid,
status: wrappedCcpa.status,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ public static void Broadcast<T>(params object[] list) where T : IConsentEventHan
break;
case nameof(IOnConsentError):
Exception exception= (Exception)list[0];

CmpDebugUtil.LogError("Error message: " + exception.Message);
CmpDebugUtil.LogError("Stack Trace: " + exception.StackTrace);

BroadcastEventDispatcher.Execute<IOnConsentError>(null, (i, d) => i.OnConsentError(exception));
break;
case nameof(IOnConsentUIReady):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@

<androidPackages>
<!-- <androidPackage spec="org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.0" />-->
<androidPackage spec="com.sourcepoint.cmplibrary:cmplibrary:7.2.7" />
<androidPackage spec="com.sourcepoint.cmplibrary:cmplibrary:7.6.0" />
</androidPackages>
</dependencies>
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.