cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to show warning?

martin_schffler
Participant
0 Kudos

Is it possible to return a message from a user script that is not interpreted as an error?

What I want to do is to check a few things when a project is saved and show a warning if something is not quite right.

Throwing an exception shows the message but also aborts the saving of the project. That's fine for real errors but if I just wnat to hint to the user that something he entered is not plausible that behaviour is bad.

I already tried different targets but even "saved" is called before actually saving the changes.

Is there another way of passing messages to the user besides throwing exceptions? Or is there another target I could use?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member208675
Active Contributor
0 Kudos

Hi

Yes there is another way to show warning messages.

You have to look for these messages in logs.

For displaying warning messages try these lines in your script.

logMsg = Logger.createLogMessage(session);

logMsg.setLogMessage("Your Message" );

Logger.warning(logMsg);

Cheers !!!

martin_schffler
Participant
0 Kudos

Sorry, but you misunderstood what I was asking.

I am well aware of the logging API but I want to show the message to the user upon saving but without aborting the saving itself (like throwing an exception would do).

Former Member
0 Kudos

Hi Martin,

I have check all possible solution. but I guess this is not possible with present ESO application.

Regards

~Ankush

Former Member
0 Kudos

I don't think it is possible to throw warning messages. I have check the IAPI a throusand times to find something but without any luck. What you can try to do is to create an extension at the top of the page and write a message into it. Via basic HTML codes you can even change the color of the text to make it more flashy.