MuleSoft · DataWeave
You called the function '++' with these arguments
Short answer
This DataWeave error means a function was called with a kind of argument it does not accept, most often null. Find which argument is Null in the list the message prints, then give it a fallback with the default operator.
VerifiedLast verified
01Error text
You called the function '++' with these arguments:
(the argument values and types are listed here)
But it expects one of these combinations:
(the accepted type combinations are listed here)02Likely causes
- An argument is Null and the function does not accept Null. The exception class is
org.mule.weave.v2.exception.UnsupportedTypeCoercionException. - The payload has no MIME type set. It then defaults to
application/java, and its content is handled as a String and not as a JSON object. The docs show this with the messageYou called the function 'Value Selector' with these arguments:.
03How to fix it
- Read the argument list in the message. It shows the type of each value that was passed, so you can see which one is Null or a String.
- Give a possibly null value a fallback with the
defaultoperator, for examplepayload.message default "" ++ " A text". - If the payload is treated as a String, make sure its MIME type is set where the data enters the flow, for example with
outputMimeTypeon the source or operation that produces it. - Run the script again with the same input to confirm the message is gone.
iNotes
The function name in the message changes with the function you called. ++ is the example in the DataWeave documentation.
04Official documentation
→Related errors
- MULE:EXPRESSIONMULE:EXPRESSION means an error occurred while Mule evaluated a DataWeave expression. Find the expression named in the log, check the values it reads for nulls or wrong types, and add a default or a handler.
- Cannot coerce String to DateThis DataWeave error means a String could not be converted to a Date because the text is not a valid date for the format and parsing mode in use. Correct the input value, or pick a parsing mode that fits how strict you need to be.
Test every fix in a non-production environment before you apply it to production. See how entries are verified.
More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer