Sumit Bafna
Sumit Bafna

Reputation: 3

Fetching Error Code in mule

I want to create a custom exception message in case exception is thrown by my mule service. In order to do that, i want to separately capture mule generated ErrorCode. Is there any property using which i can get that value? I tried using #[org.mule.config.ExceptionHelper.getErrorCode(Exception.class)]" but this returned -1 as a value instead of the actual exception code.

What method can i use to fetch ErrorCode?

Upvotes: 0

Views: 478

Answers (1)

David Dossot
David Dossot

Reputation: 33413

You are supposed to pass the class of the current exception, ie:

#[org.mule.config.ExceptionHelper.getErrorCode(exception.class)]"

exception is the current exception while Exception is the java.lang.Exception class for which there is no error code associated.

Upvotes: 1

Related Questions