View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
11303Bug reportsPluginspublic2016-06-03 15:18
Reporterfrederikprijck Assigned ToLouisGac 
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Summary11303: Allow Error Handling
Description

Hi,

I was talking with Mazi on IRC about a plugin I would love to write. However, I am not able to find the correct hook for my use case. Mazi told me to go to bugs.limesurvey.com and describe my usecase.

We would love to create a plugin that logs our PHP Exceptions to RayGun (https://raygun.com/).
RayGun has a PHP extension to integrate this inside PHP: https://github.com/MindscapeHQ/raygun4php

However, I do not seem to find the correct hook for LimeSurvey to handle Exceptions.

My guess is there are 2 Events that can be usefull:

  • Some event to hook in to the application bootstrap to set up the php set_exception_handler and set_error_handler handlers.
  • Some event that is raised when an error occurs.
  • Or are there other possibilities inside limesurvey ?

Events to handle exception handling will help the community in production environments.

Maybe we can have a chat about this ? I can do the PR for LimeSurvey 2.06lts if changes are needed to be able to hook into exceptions.

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)2.06lts
I will donate to the project if issue is resolvedNo
Browser
Database type & versionN.A.
Server OS (if known)N.A.
Webserver software & version (if known)N.A.
PHP VersionN.A.

Users monitoring this issue

There are no users monitoring this issue.

Activities

frederikprijck

frederikprijck

2016-05-31 08:46

reporter   ~39037

So basicly my usecase has two parts:

  • Allow exception handling in limesurvey using a plugin so we can create several plugins to handle exceptions and configure them through plugin settings.

  • Create the first plugin (RayGun)

Mazi

Mazi

2016-05-31 08:52

updater   ~39038

Denis, what do you think, how can we best deal with it?

Does Yii support catching errors and logging them? That may be a good start for a new plugin event.

DenisChenu

DenisChenu

2016-05-31 09:05

developer   ~39039

See http://www.yiiframework.com/doc/guide/1.1/en/topics.error

And get inspiration : https://github.com/SondagesPro/LimeSurvey-SondagesPro/commit/b87289a229bf6bfacd091cf22b56f1471385ae50

But, actually : i don't know if anything was implemented in 2.50 or 2.06.

frederikprijck

frederikprijck

2016-05-31 09:10

reporter   ~39040

Controller is actually to late to hook into error handling. Errors can occur in routing, controller constructors ...

frederikprijck

frederikprijck

2016-06-01 08:41

reporter   ~39054

I'll currently implement the exception logging on controller level. But I do think it would be a great addition for LimeSurvey to be able to have a better exception handling for production environments using plugins, as that way every team can plugin their prefered exception handling tool.

DenisChenu

DenisChenu

2016-06-01 08:47

developer   ~39055

Last edited: 2016-06-01 08:48

I don't say you can use exiting plugin event :). But get inspiration on this event to allow plugin to add their own exception handling.

There are surely some solution in Yii :). You're right : it's not the role of the controller to handle error.

LouisGac

LouisGac

2016-06-03 11:15

developer   ~39132

Could you please open this ticket as a feature request and not a bug report?

frederikprijck

frederikprijck

2016-06-03 11:26

reporter   ~39134

Done: https://bugs.limesurvey.org/view.php?id=11333

LouisGac

LouisGac

2016-06-03 15:18

developer   ~39202

thank you ;-)

Issue History

Date Modified Username Field Change
2016-05-31 08:44 frederikprijck New Issue
2016-05-31 08:46 frederikprijck Note Added: 39037
2016-05-31 08:51 Mazi Assigned To => DenisChenu
2016-05-31 08:51 Mazi Status new => assigned
2016-05-31 08:52 Mazi Note Added: 39038
2016-05-31 09:01 DenisChenu Assigned To DenisChenu =>
2016-05-31 09:05 DenisChenu Note Added: 39039
2016-05-31 09:10 frederikprijck Note Added: 39040
2016-06-01 08:41 frederikprijck Note Added: 39054
2016-06-01 08:47 DenisChenu Note Added: 39055
2016-06-01 08:47 DenisChenu Status assigned => new
2016-06-01 08:48 DenisChenu Note Edited: 39055
2016-06-03 11:15 LouisGac Note Added: 39132
2016-06-03 11:15 LouisGac Assigned To => LouisGac
2016-06-03 11:15 LouisGac Status new => feedback
2016-06-03 11:26 frederikprijck Note Added: 39134
2016-06-03 11:26 frederikprijck Status feedback => assigned
2016-06-03 15:18 LouisGac Note Added: 39202
2016-06-03 15:18 LouisGac Status assigned => closed
2016-06-03 15:18 LouisGac Resolution open => fixed