Skip to content

Commit

Permalink
Skip GraalJS specific errors in diagnostic logs
Browse files Browse the repository at this point in the history
  • Loading branch information
shanggeeth committed Sep 30, 2024
1 parent dfb633c commit 4ec89e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.AdaptiveAuthentication.ADAPTIVE_AUTH_LONG_WAIT_TIMEOUT;
import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.BACK_TO_FIRST_STEP;
import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.JSAttributes.PROP_CURRENT_NODE;
import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants.POLYGLOT_CLASS;
import static org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils.promptOnLongWait;

/**
Expand Down Expand Up @@ -142,8 +143,11 @@ public void handle(HttpServletRequest request, HttpServletResponse response, Aut
FrameworkConstants.LogConstants.AUTH_SCRIPT_LOGGING)
.inputParam(LogConstants.InputKeys.TENANT_DOMAIN, context.getTenantDomain())
.inputParam(LogConstants.InputKeys.APPLICATION_NAME, context.getServiceProviderName())
.resultMessage("Error while parsing the authentication script. Nested exception is: " + graph
.getErrorReason())
.resultMessage(
graph.getErrorReason().contains(POLYGLOT_CLASS) ? "Error while parsing the " +
"authentication script." :
"Error while parsing the authentication script. Nested exception is: " + graph
.getErrorReason())
.logDetailLevel(DiagnosticLog.LogDetailLevel.APPLICATION)
.resultStatus(DiagnosticLog.ResultStatus.FAILED));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public abstract class FrameworkConstants {
public static final String OPENJDK_NASHORN = "openjdkNashorn";
public static final String NASHORN = "nashorn";
public static final String GRAAL_JS = "graaljs";
public static final String POLYGLOT_CLASS = "org.graalvm.polyglot";

// Attribute sync related constants.
public static final String ATTRIBUTE_SYNC_METHOD = "attributeSyncMethod";
Expand Down

0 comments on commit 4ec89e2

Please sign in to comment.