How to capture error.class in javascript

HI,

I am using context.getVariable("error.class") but the value is coming as null.

However, i can see the variable with a value in the trace.

Thanks,

Krish

@Anil Sagar, @Dino

4716-capture.png

0 3 163
3 REPLIES 3

Not applicable

@Krish If you have continueOnError = false set for your policy, you should be able to get the fault names in fault handling rules as mentioned here http://docs.apigee.com/api-services/content/error-code-reference

@Maruti Chand

I have continueOnError = false and that's why the javascript policy is getting executed. But I am not able to capture the value of error.class variable. I don't need the fault name or fault details. I need the error.class which is causing the error.

Thanks,

Krish

okay I did not realize that you had js in the fault handler. AFAIK you can't access the error.class in your jsc. @Krish.