demianturner / sgl-docs-tickets-migration-test

0 stars 0 forks source link

Different error messages for production and development #1265

Open demianturner opened 11 years ago

demianturner commented 11 years ago

Depending on the current site status it should be possible to let SGL output different error info:

demianturner commented 11 years ago

[demian] dude - pls assign patches to me or else they don't show up in the patch report.

demianturner commented 11 years ago

[demian] Hi Lyric

I like the intention of the patch, but find the argument order kind of ugly. If I send a user-friendly message it will be necessary to

{{{ SGL::raiseError('no db connection', SGL_ERROR_DBPROBS, null, false, 'can you please try later'.) }}}

I think perhaps a cleaner way would be to make the first arg optionally an array, where the 2nd key would be the user-friendly message:

{{{

SGL::raiseError(array( 'no db connection', 'you should not have clicked that'), SGL_ERROR_DBPROBS); }}}

Might be work sending to the dev list for feedback.

demianturner commented 11 years ago

[demian] until patch comes in that implements my cleaner suggestion, i think this is not something that will improve framework.

demianturner commented 11 years ago

[lyric] I just tried to implement your cleaner suggestion. Hope it nearly meets your requirements.

demianturner commented 11 years ago

[lyric] PS:

By error the file was uploaded twice.

Please ignore 'cleaner.2.diff' and if possible remove it together with this note.

Sorry!!

demianturner commented 11 years ago

[demian] Hi lyric - i like this better but it still needs massaging:

{{{ {if:conf[debug][sessionDebugAllowed]} }}}