Skip to main content
17-Peridot
August 7, 2020
Question

How to handle exception in Mashup using customized widget

  • August 7, 2020
  • 2 replies
  • 2271 views

Hi , 

The bounded service in Mashup will popup the exception message raised from the ThingWorx javascript service , it's default behavior.   

 

I want to use a customized  message box to display the exception message ,  but how does the customized widget catch the exception of the ThingWorx service ? 

 

Regards,

Sean

2 replies

Community Manager
August 19, 2020

Hi @seanccc.

 

Can you provide details of the use case?  What happens when the service runs successfully?  What are some of the error messages you need to display?  This may help us to provide a better example of how to meet your requirements.

 

Regards.

 

--Sharon

seanccc17-PeridotAuthor
17-Peridot
August 28, 2020

@slangley ,

The ThingWorx service can only set fix successful message which display in the mashup.  I want do display a customized message because: 

  • the service may has different kinds of return result and for each result the displayed message should be different.  This can be implemented via expression and popup mashup, but doing so for every service is very tedious. 
  • the customer don't like the default message box of the service, they want to change the font/color/background/size of the message box, so does for the error message box. 

So I want to know if there's a general way to catch the result of the service, whatever it's successful or failed. Then I can display the result in a customized widget(message box). 

 

Regards,

Sean

19-Tanzanite
August 31, 2020
Sean, I believe the option of having a generic "Error Mashup" that you build once and reuse, is still the most flexible. You could reuse a EventRouter that has as inputs the results of the services, so you'd need just another expression that decides if the navigation would be displayed or not and the navigation.

If you're not inclined to do this, one of my previous colleagues, Gabriel Bucur, designed a CSS styling code for that, that you can take a look in the GitBackup.Main.Mashup from the GitBackupExtension. Look in the CustomCSS section and search for /* status message styled */
It's not that flexible though.
Community Manager
September 22, 2020

Hi @seanccc.

 

If you feel your question has been answered, please mark the Accepted Solution for the benefit of others with the same question.

 

Thank you for your participation in our community!

 

Regards.

 

--Sharon