Merge branch 'MDL-74484_final-deprecation-of-print_error' of https://github.com/ziegenberg/moodle

This commit is contained in:
Ilya Tregubov 2024-05-13 09:16:40 +08:00
commit 5717e7ecd3
2 changed files with 9 additions and 16 deletions

View File

@ -2872,24 +2872,16 @@ function get_array_of_activities() {
}
/**
* Abort execution by throwing of a general exception,
* default exception handler displays the error message in most cases.
*
* @deprecated since Moodle 4.1
* @todo MDL-74484 Final deprecation in Moodle 4.5.
* @param string $errorcode The name of the language string containing the error message.
* Normally this should be in the error.php lang file.
* @param string $module The language file to get the error message from.
* @param string $link The url where the user will be prompted to continue.
* If no url is provided the user will be directed to the site index page.
* @param object $a Extra words and phrases that might be required in the error string
* @param string $debuginfo optional debugging information
* @return void, always throws exception!
*/
function print_error($errorcode, $module = 'error', $link = '', $a = null, $debuginfo = null) {
debugging("The function print_error() is deprecated. " .
"Please throw a new moodle_exception instance instead.", DEBUG_DEVELOPER);
throw new \moodle_exception($errorcode, $module, $link, $a, $debuginfo);
#[\core\attribute\deprecated(
'Please throw a new moodle_exception instance instead.',
since: '4.1',
mdl: 'MDL-71062',
final: true
)]
function print_error(): void {
\core\deprecation::emit_deprecation_if_present([__FUNCTION__]);
}
/**

View File

@ -7,6 +7,7 @@ information provided here is intended especially for developers.
* The previously deprecated function `search_generate_text_SQL` has been removed and can no longer be used.
* The following previously deprecated methods have been removed and can no longer be used:
- `renderer_base::should_display_main_logo`
* Final deprecation of print_error(). Use moodle_exception instead.
=== 4.4 ===