WP_CLI

UpgraderSkin::error()publicWP-CLI 1.0

Show error message.

Method of the class: UpgraderSkin{}

No Hooks.

Return

null. Nothing.

Usage

$UpgraderSkin = new UpgraderSkin();
$UpgraderSkin->error( $error );
$error(string) (required)
Error message.

UpgraderSkin::error() code WP-CLI 2.8.0-alpha

public function error( $error ) {
	if ( ! $error ) {
		return;
	}

	if ( is_string( $error ) && isset( $this->upgrader->strings[ $error ] ) ) {
		$error = $this->upgrader->strings[ $error ];
	}

	// TODO: show all errors, not just the first one
	WP_CLI::warning( $error );
}