Deprecated 'Session.ExceptionMessage'

Deprecated 'Session.ExceptionMessage'

  

So, after the upgrade for P10, there is a couple of new warnings out there, one of them being the Deprecated 'Session.ExceptionMessage' ('Session.ExceptionMessage' is being deprecated. Use the 'ExceptionMessage' runtime property of the 'Exception Handler' node, available inside exception handler flows.)

This is nice, but how do we manage to use ExceptionMessage in the same manner that, lets say, the InternalError page that was automatically built when you created a new app (it prints out the error message on screen)?

Best regards,

PC

I don't know what OS intended to do here, of course, but you can add an exception handler ("OnException") to a UI Flow to handle uncaught exceptions. If you need to display an InternalError page, you can pass the exception message as a parameter to the page you're redirecting to (or set a session variable yourself).

Perhaps not the most elegant solution, but it should work.

The new error handling is more localised and easier to control in OS10 and is more aligned with a Try/Catch way of thinking.

The primary warning that I have seen relates to the InternalError screen which is only relevant when running in the Personal Area. To remove that warning I add a text input ExceptionMessage and replace Session.ExceptionMessage in the expression.

Other than that I have not had any other issues when I have been upgrading.



Solution

Hi Ouen,

That is the correct behavior and it is what OutSystems is expecting you to do.

In a next version, that variable will be removed so this is a transitory version, allowing users to fix their Applications before OutSystems remove that variable.

As you said, the new Error handling is more localized and easier to control and it is more similar with Try/Catch way. OutSystems want to improve and do better every time and I think that this is the correct way for Error Handling.

If I could help you on this, let me know.

Best regards :)

Solution

What's not making any sense is, when creating a new web application in 10, the exact warning is created.  Before ending such a procedure, shouldn't the latest version be creating handler the way it was intended?

Hi Jay, 

You're correct. We will fix it

Thanks for the heads up.

Ouen Worth wrote:

The new error handling is more localised and easier to control in OS10 and is more aligned with a Try/Catch way of thinking.

The primary warning that I have seen relates to the InternalError screen which is only relevant when running in the Personal Area. To remove that warning I add a text input ExceptionMessage and replace Session.ExceptionMessage in the expression.

Other than that I have not had any other issues when I have been upgrading.




What you passed in the text input ?  is it "AllExceptions.ExceptionMessage"

.Sunny Pathai wrote:

Ouen Worth wrote:

The new error handling is more localised and easier to control in OS10 and is more aligned with a Try/Catch way of thinking.

The primary warning that I have seen relates to the InternalError screen which is only relevant when running in the Personal Area. To remove that warning I add a text input ExceptionMessage and replace Session.ExceptionMessage in the expression.

Other than that I have not had any other issues when I have been upgrading.




What you passed in the text input ?  is it "AllExceptions.ExceptionMessage"


Yes Sunny. That's it. :)

Sorry for jumping the queue, so are there anyway we can get rid of that message please? Or this has been fixed already?

Hi Connie,

The message tells you that some of your code still uses the old way of doing things. You need to fix your code yourself in order to get rid of the messages.

Hi Kilian,


I'm still unsure as to what I need to do to kill the warning. This is my exact problem, an internal error page having that specific warning. Please advise what I need to do...


Connie

Oh Kilian,


We have fixed this now. Thanks for your help.


Connie

Hi Connie,

Here are the steps to add exception handling to a Web Flow:

  1. Right click the Flow, select "Add On Exception Action".
  2. Double click the OnException Action, it will already have a flow.
  3. Click the ExceptionHandler1, set its Exception Property (e.g. to "All Exceptions").
  4. Click the "(Undefined)" Screen and set its Destination Property.

If you want to display the exception message on the Error Screen (i.e. the Screen you set as Destination), pass the "AllExceptions.ExceptionMessage" as a Parameter.

Thanks Kilian, you rock. Problem solved.

Glad I could be of help Connie! Happy coding :).