Yoast\WP\SEO\AI\Authentication\Application
OAuth_Auth_Strategy::error_code
Resolves the best available error code for an errored response.
The body's error_code is not guaranteed to be present (the RFC 6750/9449 spec carries the machine-readable code in the WWW-Authenticate challenge instead), so the challenge's error="…" token is preferred and the body error_code is the fallback. Returns an empty string when neither is available.
Метод класса: OAuth_Auth_Strategy{}
Хуков нет.
Возвращает
Строку. The error code, lower-cased, or an empty string.
Использование
// private - только в коде основоного (родительского) класса $result = $this->error_code( $exception ): string;
- $exception(Remote_Request_Exception) (обязательный)
- The exception to inspect.
Код OAuth_Auth_Strategy::error_code() OAuth Auth Strategy::error code Yoast 28.3
private function error_code( Remote_Request_Exception $exception ): string {
$challenge_error = $this->challenge_error( $exception->get_response_headers() );
if ( $challenge_error !== '' ) {
return $challenge_error;
}
return \strtolower( $exception->get_error_identifier() );
}