Plugin Error Messages

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Plugin Error Messages

Post by cmb » Sat Feb 01, 2014 10:41 pm

Hello Community,

I just received a message regarding error messages after upgrading to XH 1.6:
Not readable
FILENAME
Apparently, these were caused by Dlcounter_XH by calling e('notreadable', 'file', $filename), what seems to be a common pattern. However, from the error message it is quite unclear which plugin caused it. It may be a good idea to add this information to error messages reported by plugins, e.g.
Dlcounter_XH: Not readable
FILENAME
CMSimple_XH 1.6 introduced XH_message($type, $message, ...), which generally might be preferable over calling e(), because the latter has some internationalization issues. Of course, it is possible to include the plugin name in the $message string, but we might consider to add a new parameter $module to the function, which specifies the name of the plugin resp. "Core" or "CMSimple_XH". Adding this parameter as last parameter is possible and would not break API compatibility, but inserting it as first/second/third parameter is much cleaner (otherwise the parameter would not be present in the function signature), and XH_message() is most likely not in widespread use, so we may consider to change the function signature.

What do you think? Any comments are appreciated!

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply