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

MuleSoft error
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 message You called the function 'Value Selector' with these arguments:.

03How to fix it

  1. 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.
  2. Give a possibly null value a fallback with the default operator, for example payload.message default "" ++ " A text".
  3. If the payload is treated as a String, make sure its MIME type is set where the data enters the flow, for example with outputMimeType on the source or operation that produces it.
  4. 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

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

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.