MDL-20293 strict param validation support

This commit is contained in:
skodak
2009-09-15 20:08:47 +00:00
parent 2367726155
commit a3f7cbf64e
4 changed files with 92 additions and 4 deletions
+16
View File
@@ -121,6 +121,22 @@ class coding_exception extends moodle_exception {
}
}
/**
* Exception indicating malformed parameter problem.
* This exception is not supposed to be thrown when processing
* user submitted data in forms. It is more suitable
* for WS and other low level stuff.
*/
class invalid_parameter_exception extends moodle_exception {
/**
* Constructor
* @param string $debuginfo some detailed information
*/
function __construct($debuginfo=null) {
parent::__construct('invalidparameter', 'debug', '', null, $debuginfo);
}
}
/**
* An exception that indicates something really weird happended. For example,
* if you do switch ($context->contextlevel), and have one case for each