Custom error message

:bullseye: What is your goal?

Customising error messages.

:thinking: What is the problem & what have you tried?

I have a module that sometimes throws. I would like to customise the error message to include some information from other modules, while retaining the current workflow behaviour. (ie aborting the scenario, or whatever it is that happens)

Hey there,

right click the module that sometimes throws errors and create your own error handling logic instead of using the built in ones. Then you can collect whatever info you require and send it however you like. I prefer slack messages over emails for example.

Hi,

Sorry, I lost my notifications.

Thanks. What I’ve done is I used my custom assertion module as the error handler, which lets me effectively rethrow the error with a new message.

So, it works, but both the original and the new error is included in the email report. How can I ignore the original error?

Can you show a screenshot of how you have it configured right now?

Certainly.

Email notification contents:

Details:

  • [400] Kunde inte hitta artikel. (AVTALAT) (error code: 2001302) (invoice #290426-0036)

  • [400] Kunde inte hitta artikel. (AVTALAT) (error code: 2001302)

My custom module:

{
	"response": {
		"valid": {
			"condition": "{{parameters.assertion}}",
			"message": "{{parameters.errorMessage}}",
			"type": "{{parameters.errorType}}"
		},
		"output": {"result": "{{parameters.assertion}}"}
	}
}

Add a router before that Assert module and add an ignore module so the main error is ignored.

That works perfectly. Thanks!