wpdb::bail( string $message, string $error_code = '500' )

Wraps errors in a nice header and footer and dies.


Description

Will not die if wpdb::$show_errors is false.


Parameters

$message

(Required) The error message.

$error_code

(Optional) A computer-readable string to identify the error.<br> Default '500'.

Default value: '500'


Return

(void|false) Void if the showing of errors is enabled, false if disabled.


Source

File: wp-includes/class-wpdb.php

	public function bail( $message, $error_code = '500' ) {
		if ( !$this->show_errors ) {
			if ( class_exists( 'WP_Error', false ) ) {
				$this->error = new WP_Error($error_code, $message);
			} else {
				$this->error = $message;
			}
			return false;
		}
		wp_die($message);
	}

Changelog

Changelog
Version Description
1.5.0 Introduced.