How to deal with exeptions or errors in appian. I would like to show a custom error message to the user instead of technical terms. At the same time , the errors with specific technical terms must be logged into a file ,so that the relevant team can look into it. So how do i do these two things, Custom error message and Error logging .
Thanks,
Discussion posts and replies are publicly visible
The answer is that it depends on the context. Some errors are handled automatically by Appian and do not give you the ability to implement a try/throw/catch pattern. Other errors do. So ti really depends on what objects you're using and what the nature of the "error" is that you want to catch and provide a user-friendly display of.
Lets say for a send email smart service , I want to display a user friendly message when the email is not sent or for invalid email address.
Another situation will be , a user doesnt have privelege for a page or some page had error in opening up . In this case I saw the error page given by appian by default had all technical details instead of a user friendly message.
So like these scenarios, is it possible to handle them with a custom errror message
So what does the output in send emaill smart service give then? It will be just saying if its a viable email? So, for incorrect format ,its going to break?
When I provide an invalid email address I see this as the Data Outputs:
Sorry for the late reply, but somehow this smart service is breaking for me.I have attached screenshots below. Any help is much appreciated, thanks.
What is the error? If you right-click the node that is in error you'll get a menu. Select the "1 instances" option, highlight the node in the list and then select the 'View Node Details': You should land on a dialogue with an 'Error' tab selected where the details of the error are, a bit like this:
Here is what i got
Ok, so looks like the Send E-Mail node expects to have at least ONE valid recipient. I guess if you had one valid email address and one invalid one it would work (worth trying that out).
But as I said previously if you're capturing the email addresses in your first User Input Task then you should add validation to the field(s) where you're capturing the email addresses and not let the User submit the form if the email addresses are invalid.
Yes you are correct, it did go to the exception flow when one mail was valid in the send email smart service node. But that's bad as we might be loading a group of recepients from a cdt and it's not guaranteed that atleast one will be valid all the time.
Thank you , anyway.
So, even in this circumstance you should write a rule to validate the format of the email addresses and route to someone to fix/remove BEFORE the Send E-Mail smart service is invoked. If you encapsulate this as an Expression Rule you can use it in the Process, AND you can re-use it in any interface where you're capturing Email addresses. And it's just good practice to validate the data you're working with before passing it downstream for processing.
That's ok we can do a basic regex check. The main purpose of this question, was to find a approach to handle errors and exceptions of a smart service or anything, Now I came to know we can make use of the node outputs to make exception flows and custom error messages.
It will also be nice if appian let's us to edit the basic product code itself. Many low code development platforms like wordpress let's us change the background code completely and add new features. Appian must consider letting that flexibility for the designer. And yes, those who find it difficult to code are always allowed to use the abstractions provided by appian.
Thank you
I understand the request, but if Appian allowed you to change the base code then in effect you'd be creating a fork of the code and it would be unsupportable by Appian, which is part of the platform offering - the code AND the associated support. You can write your own plug-ins to extend the platform capability, and you can submit requests for changes to existing features (e.g. to ask for the Send E-mail Smart Service to allow you to implement a try/throw/catch pattern and implement your own error-handling!)