Skip to content
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 @@ -84,7 +84,10 @@ public void load() {
}

} catch (JSONException e) {
throw new RuntimeException(e);
// FR-25948: don't throw — a RuntimeException here hard-kills the app on a config error.
// Log and abort initialization; JS calls surface the error instead of a crash.
Log.e("FronteggNative", "Failed to parse Frontegg regions config", e);
return;
}

Class<?> mainActivityClass = resolveMainActivityClass();
Expand Down Expand Up @@ -114,7 +117,9 @@ public void load() {
}

if (baseUrl == null || clientId == null) {
throw new RuntimeException("Missing required config parameters: baseUrl, clientId");
// FR-25948: don't throw — log and abort initialization instead of crashing the app.
Log.e("FronteggNative", "Missing required config parameters: baseUrl, clientId");
return;
}
if (baseUrl.startsWith("https://")) {
baseUrl = baseUrl.substring(baseUrl.indexOf("://") + 3);
Expand Down
7 changes: 5 additions & 2 deletions ios/Plugin/FronteggNativePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ public class FronteggNativePlugin: CAPPlugin {
}

if(regions.isEmpty){
// FR-25948: don't exit(1) — hard-killing the app on misconfiguration is worse than
// leaving the plugin uninitialized. Log and return; JS calls surface the error.
print("Frontegg Error: Missing regions configurations")
exit(1)
return
}
fronteggApp.manualInitRegions(regions: regions,
handleLoginWithSocialLogin: handleLoginWithSocialLogin,
Expand All @@ -76,8 +78,9 @@ public class FronteggNativePlugin: CAPPlugin {
handleLoginWithSocialLogin: handleLoginWithSocialLogin,
handleLoginWithSSO: handleLoginWithSSO)
}else {
// FR-25948: don't exit(1) — log and return instead of terminating the process.
print("Frontegg Error: Missing baseUrl or clientId in project configurations")
exit(1)
return
}
}

Expand Down
Loading