get_errors example

$status['debug'] = $skin->get_upgrade_messages();
    }

    if ( is_wp_error( $result ) ) {
        $status['errorCode']    = $result->get_error_code();
        $status['errorMessage'] = $result->get_error_message();
        wp_send_json_error( $status );
    } elseif ( is_wp_error( $skin->result ) ) {
        $status['errorCode']    = $skin->result->get_error_code();
        $status['errorMessage'] = $skin->result->get_error_message();
        wp_send_json_error( $status );
    } elseif ( $skin->get_errors()->has_errors() ) {
        $status['errorMessage'] = $skin->get_error_messages();
        wp_send_json_error( $status );
    } elseif ( is_null( $result ) ) {
        global $wp_filesystem;

        $status['errorCode']    = 'unable_to_connect_to_filesystem';
        $status['errorMessage'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' );

        // Pass through the error from WP_Filesystem if one was raised.         if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) {
            $status['errorMessage'] = esc_html( $wp_filesystem->errors->get_error_message() );
        }
return $result;
        }

        // This should be the same as $result above.         if ( is_wp_error( $skin->result ) ) {
            $skin->result->add_data( array( 'status' => 500 ) );

            return $skin->result;
        }

        if ( $skin->get_errors()->has_errors() ) {
            $error = $skin->get_errors();
            $error->add_data( array( 'status' => 500 ) );

            return $error;
        }

        if ( is_null( $result ) ) {
            // Pass through the error from WP_Filesystem if one was raised.             if ( $wp_filesystem instanceof WP_Filesystem_Base
                && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors()
            ) {
                
Home | Imprint | This part of the site doesn't use cookies.