Want to remove default Javascript Error response content

Not applicable

Hi, Currently i am getting below response if any javaScript Error occured in my proxy. I want to remove/Customize this response message.

{"fault":{"faultstring":"Execution of target-ca-response failed with error: Javascript runtime error: \"ReferenceError: \"logger\" is not defined. (target_ca_response_js#47). at line 47 \"","detail":{"errorcode":"steps.javascript.ScriptExecutionFailed"}}}

No policy seems working after getting this error. i also tried to put my policy under <FaultRules> tag. but that also didn't work for me.

Suggest me a solution.


Applied in proxy end point:

        <FaultRule name="invalid_key_rule">
                <Condition>(message.status.code = 500)</Condition>

Error500 railsefault policy

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RaiseFault async="false" continueOnError="false" enabled="true" name="Error500">
            <ReasonPhrase>Server Error</ReasonPhrase>
           <Payload contentType="text/plain">Error Occured</Payload>
        <Payload contentType="application/json">{request.content}</Payload>
        <Payload contentType="application/json"></Payload>
        <Payload contentType="application/json">{message.content}</Payload>
        <Payload contentType="application/json">{error.content}</Payload>
0 5 677

Participant V

Hi @Vinay Soni,

This is a hard error & must be handled within a Fault Rule. Are you able to see the Raise Fault being executed in the trace? If not there is something wrong in your proxy configuration. Please create a simple proxy & try adding the Fault Rule.

The script execution errors are set in the fault.name variable. You can optionally add the below condition to identify in your Raise Fault policy.

	(fault.name="ScriptEvaluationFailed" OR fault.name="ScriptExecutionFailed")



2 4 0

@Abhishek Subramanyai have already tried to add this condition but the fault rule is not picking up in case of default error. i am also adding the trace snapshot.

Can you give a sample proxy to do thiscapture.png

0 3 0


Hi @Vinay Soni,

I have created a sample proxy to address your issue -

Snapshot -


Proxy -js-error-rev1-2016-01-11.zip



0 2 0

Hi @Abhishek Subramanya

I did in a little modification in your proxy and added the javascript at target end point. now the same fault rule stopped working but it's working if we put the faultRule in target end point.

Why it's not working in proxy end point


0 1 0


Hi @Vinay Soni,

The behavior of the Fault Rule is dependent on the place you add it. Please find the rules below -

Request Path:

  1. Fault in ProxyRequest: fault rules defined at ProxyEndpoint execute
  2. Fault in Routing: fault rule defined at ProxyEndpoint execute
  3. Fault in TargetRequest: fault rules defined at TargetEndpoint execute
  4. Fault in outbound request to target URL: fault rules defined at TargetEndpoint execute

Response Path:

  1. Fault in TargetResponse: fault rules defined at TargetEndpoint execute
  2. Fault in ProxyResponse: fault rules defined at ProxyEndpoint execute
  3. Fault in returning response to ProxyEndpoint: fault rules defined at ProxyEndpoint execute

For more information on Fault handling, please refer to Apigee documentation.



0 0 0
Top Labels in this Space
Top Solution Authors