Skip to main content

For a Raise Error Type can you set a "custom type" that would be defined when the error itself is raised?

 

I found you can set it with ${} syntax to access a properties file but I was not able to set it via a var using #[]. I could set the description this way.

 

Basically the idea would be to set the Raise Error Type from the type of the error being returned from another API. As I say we can set the description this way.

1 answer
  1. Manish Kumar Yadav (Hitachi Energy) Forum Ambassador
    Feb 17, 2021, 9:38 PM

    Hi Michal,

     

    You can not set DataWeave Expression in type area of Raise Error component because the dataType of type is string.

     

    So in type area Either you hardcode the value like below or use it from property file via ${}. But For sure you can not use dataWeave expression starting from #[ ] or the way you are trying.

    <raise-error doc:name="503_CUSTOM:SERVICE_UNAVAILABLE" doc:id="c223a9b2-4c21-4434-b40d-6f42da6e41bb" description="#[error.exception.errorMessage.typedValue.details]" type="CUSTOM:SERVICE_UNAVAILABLE"/>

    Thanks,

    Manish Kumar Yadav

    MuleSoft Forum Moderator

0/9000