WordPress.org

Make WordPress Core

Ticket #16769: 16769.patch

File 16769.patch, 590 bytes (added by hakre, 3 years ago)

Making WP_Error extending Exception

  • wp-includes/class-wp-error.php

     
    1818 * @package WordPress 
    1919 * @since 2.1.0 
    2020 */ 
    21 class WP_Error { 
     21class WP_Error extends Exception { 
    2222        /** 
    2323         * Stores the list of errors. 
    2424         * 
     
    5656         */ 
    5757        function WP_Error($code = '', $message = '', $data = '') { 
    5858                if ( empty($code) ) 
    59                         return; 
     59                        throw new WP_Error( '', 'Code parameter is missing.' ); 
    6060 
    6161                $this->errors[$code][] = $message; 
    6262