Forum Discussion

Szymon's avatar
Szymon
New Contributor II
4 years ago
Solved

Binary output - error pipeline - custom http codes

There is a requirement for the following: Error pipeline for an ultra pipeline which responses with custom HTTP code, e.g. 500. Why: …The third party API caller shall receive a proper HTTP code...
  • cjhoward18's avatar
    4 years ago

    Using a mapper and assuming your input text is at the key $text you can use the following expression to achieve your goal:

    $text.split("").reverse().reduce((accum, cur) => (accum.length - accum.split("+").length +1) % 3 == 0 ? accum + "+" + cur: accum + cur).split("").reverse().join("")