WordPress at a glance
function is not described

WC_REST_Authentication::set_error() protected WC 1.0

Set authentication error.

{} It's a method of the class: WC_REST_Authentication{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->set_error( $error );
$error(WP_Error) (required)
Authentication error data.

Code of WC_REST_Authentication::set_error() WC 5.4.1

<?php
protected function set_error( $error ) {
	// Reset user.
	$this->user = null;

	$this->error = $error;
}