I want to modify error.errotType to something else. How can I do that? I do not see any option to update error object in Mule 4. Also why in 'raise-exception', type field can not be set dynamically i.e. through dataweave expression?
I want to modify error.errotType to something else. How can I do that? I do not see any option to update error object in Mule 4. Also why in 'raise-exception', type field can not be set dynamically i.e. through dataweave expression?
Share Improve this question edited Feb 6 at 14:55 aled 25.7k4 gold badges31 silver badges46 bronze badges asked Feb 6 at 14:46 Vatsal MehtaVatsal Mehta 1152 silver badges19 bronze badges 2- 1 This feels to be an XY Problem. You should provide more details into what are you trying to achieve by changing the error type. What is the original problem you are trying to resolve? Also don't ask multiple questions in one in Stack Overflow. Open separate questions, one for each. – aled Commented Feb 6 at 14:58
- Also showing a concrete example would be helpful to understand the context. – aled Commented Feb 7 at 15:12
1 Answer
Reset to default -1Error Object in Mule 4 is immutable and you will not able to modify it,you have such component like raise-error to throw your own custom namespace and identifier based on immutable exception Object choice condition.
But in type field you can not directly exact DataWeave as it is not a f(x) enabled component but you can use string eval like below. Do check below as I have not tested.
"$(vars.something)"