Handling exceptions from an extension

Hi, I am new to Outsystems and have been learning about extensions lately. I would like to ask:

If an exception is thrown in the extension, is there any way to tell which particular exception it is? Or is at least that the exception came from (a particular) extension?

Or do I have to handle the exceptions from extensions with the "All Exceptions" exception handler? The exception messages from external libraries can get pretty wild and I would like to have some easy way to detect if the message has to be adjusted.


Thanks! Maria

From my experience with exceptions, there's a big disconnect when you're receiving exceptions from another module. They all go down do 'All Exceptions' handler (even from system modules like Users, where a wrong username/password combination should throw a specific exception but it's handled by the All exceptions). 

The standard approach, which I don't like, is to compare returned strings. 

Hi Madriano, thank you for your answer, that really is a pity, I think it would be beneficial to share the exception types...

mvp_badge
MVP

Hi Maria,

Although I am not an expert on writing extensions, I can tell you that exceptions that happen inside Extensions are already automatically logged by the platform and written to the Extension log. You can view these logs inside Service Center >> Monitoring >> Extensions. The log will include the particular extension and more specifically, in what action the exception occured.

You can also add additional auditing in specific parts of your C# code by following the instructions from this post. This type of auditing information will be written to the General log which you can also view via Service Center.

Hope this helps!

Regards,

Nordin

Hi Nordin, thank you for you answer, logging is definitely helpful when it comes to debuggin those wild exceptions. However I was looking for a possibility for checking the exception type in code and handling "normal" situations when all I have to do is inform the user.

From my experience with exceptions, there's a big disconnect when you're receiving exceptions from another module. They all go down do 'All Exceptions' handler (even from system modules like Users, where a wrong username/password combination should throw a specific exception but it's handled by the All exceptions). 

The standard approach, which I don't like, is to compare returned strings. 

Hi Madriano, thank you for your answer, that really is a pity, I think it would be beneficial to share the exception types...

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.