Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Handling Exceptions in a LimeSurvey Plugin

  • rr6704
  • rr6704's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 days 4 hours ago #268848 by rr6704
LimeSurvey version: 6.10
Own server / docker
==================
Hi, I'd like to ask about exception handling in LimeSurvey. I'm working on writing a plugin, and when an error occurs, I want to throw a CHttpException. Additionally, I'd like the error page displayed to be the same as the one shown, for example, when the same type of error is thrown by the DashboardController. How can I achieve this within a plugin? Thanks in advance for any tips or guidance! Best regards,
RR

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
6 days 3 minutes ago #268871 by DenisChenu
Replied by DenisChenu on topic Handling Exceptions in a LimeSurvey Plugin

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • rr6704
  • rr6704's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 days 2 hours ago - 5 days 2 hours ago #268915 by rr6704
Replied by rr6704 on topic Handling Exceptions in a LimeSurvey Plugin
Thank you very much for the explanation.

I can now see that CHttpException is handled as expected. However, I need to be able to throw this exception in the insert action of the SurveyAdministrationController. 

 

I can see in the application logs that the exception is thrown, but the expected error view does not appear on the page.
For comparison, if I throw the exception in the newSurvey action, the page looks as expected.

 

Does anyone know why this might be happening? Could there be something specific to the insert action affecting error handling?
 
Last edit: 5 days 2 hours ago by rr6704. Reason: typo

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 days 18 minutes ago - 5 days 17 minutes ago #268922 by DenisChenu
Replied by DenisChenu on topic Handling Exceptions in a LimeSurvey Plugin
Argl , pjax …

I hate the implantation done by LimeSurvey no error control system... !

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
Last edit: 5 days 17 minutes ago by DenisChenu.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose