How to display errors to the user client from BPM

Hi there,

I’m trying to display error messages to the user from a Method Directive BPM.

In 10.2 I would just use a Raise Exception node in the BPM Designer and it would show the error message to the user. With 2021.1, however, the error shows as undefined and only displays in the server error logs.

Does anyone know of a way to achieve this?

I was pleased to find out that you can still publish message boxes from custom code in Kinetic. If you use this code in a custom code block in your BPM, you can imitate an exception. Not sure if it will show up in the server log, but your user will get the message. And it pops up just like the undefined exceptions do.

string message = "Exception Info";
this.PublishInfoMessage(message, Ice.Common.BusinessObjectMessageType.Error, Ice.Bpm.InfoMessageDisplayMode.Individual, "FirstVar","SecondVar");

Just edit the message string with whatever information you want the user to have.

3 Likes

Oh yeah I figured this out too!

A bit strange how the Custom Code works but not the actual Raise Exception node but oh well.

Did you turn in this issue to Tech Support? You should not have to do this. the widget should still be supported even in the new kinetic screens.

1 Like

It is considered a “bad security practice” to display too much error information to the user.

As Epicor is becomes more web-based, this book will be more and more applicable:

https://www.amazon.com/Alice-Bob-Learn-Application-Security/dp/1119687357

I highly recommend it for all the coders on this site. Epicor already follows a lot of these techniques.

Hi Tim,

No I never turned this one in as I figured raising an exception via Custom Code worked fine.

OK, I just checked with Development, and this issue is being addressed by the ICE Tools team.

3 Likes

So now dev’s have an excuse for making cryptic error messages beside the usual “Too Lazy” go to? :stuck_out_tongue_winking_eye:

The preferred method is to send the user a nice message telling them you know about the error and will be working on it. Meanwhile, save the cryptic messages for the logs! :rofl:

In addition to the book, if you have a PluralSight membership or catch them during one of their free weekends, this is a good course that describes security and logging errors:

https://app.pluralsight.com/library/courses/securely-handling-errors-logging-events-aspdotnet-aspdotnet-core/table-of-contents