MDL-34065 lib: improve two debugging messages.

If the string passed to get_string is empty, say that. Don't say that it
contains illegal characters.

When relying on the __call magic in plugin_renderer_base, when the
method cannot be found, include the right class name in the error
message.
This commit is contained in:
Tim Hunt
2012-07-05 13:48:12 +02:00
committed by Eloy Lafuente (stronk7)
parent c3fcad7d55
commit fede0be5de
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -228,12 +228,12 @@ class plugin_renderer_base extends renderer_base {
*/
public function __call($method, $arguments) {
if (method_exists('renderer_base', $method)) {
throw new coding_exception('Protected method called against '.__CLASS__.' :: '.$method);
throw new coding_exception('Protected method called against '.get_class($this).' :: '.$method);
}
if (method_exists($this->output, $method)) {
return call_user_func_array(array($this->output, $method), $arguments);
} else {
throw new coding_exception('Unknown method called against '.__CLASS__.' :: '.$method);
throw new coding_exception('Unknown method called against '.get_class($this).' :: '.$method);
}
}
}