Skip to content

Commit

Permalink
Merge pull request #12724 from PasanT9/res_not_found
Browse files Browse the repository at this point in the history
Handle RESOURCE NOT FOUND error correctly
  • Loading branch information
PasanT9 authored Dec 17, 2024
2 parents a731ed2 + 5033b48 commit 6396e5e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public static final class ERROR_CODE_RANGES {
public static final int RESOURCE_NOT_FOUND_ERROR_CODE = 404;
public static final int METHOD_NOT_ALLOWED_ERROR_CODE = 405;
public static final int ENDPOINT_SUSPENDED_ERROR_CODE = 303001;
public static final int RESOURCE_NOT_FOUND_APIM_ERROR_CODE = 900906;

public static final int WS_BAD_GATEWAY_ERROR_CODE = 1014;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ public boolean isResourceNotFound() {
if (messageContext.getPropertyKeySet().contains(SynapseConstants.ERROR_CODE)) {
int errorCode = (int) messageContext.getProperty(SynapseConstants.ERROR_CODE);
return messageContext.getPropertyKeySet().contains(RESTConstants.PROCESSED_API)
&& errorCode == Constants.RESOURCE_NOT_FOUND_ERROR_CODE;
&& (errorCode == Constants.RESOURCE_NOT_FOUND_ERROR_CODE
|| errorCode == Constants.RESOURCE_NOT_FOUND_APIM_ERROR_CODE);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ private boolean isAuthFaultRequest() {

int errorCode = getErrorCode();
return errorCode >= Constants.ERROR_CODE_RANGES.AUTH_FAILURE_START
&& errorCode < Constants.ERROR_CODE_RANGES.AUTH_FAILURE__END;
&& errorCode < Constants.ERROR_CODE_RANGES.AUTH_FAILURE__END
&& errorCode != Constants.RESOURCE_NOT_FOUND_APIM_ERROR_CODE;
}

private boolean isThrottledFaultRequest() {
Expand Down

0 comments on commit 6396e5e

Please sign in to comment.