Skip to content
Snippets Groups Projects
Commit a0fab93b authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3156222 by yas: Hotfix - Fix an Internal Server Error "Call to a member...

Issue #3156222 by yas: Hotfix - Fix an Internal Server Error "Call to a member function addError() on null in Drupal\k8s\Service\K8sClientExtension\K8sClient->sendRequest()"
parent e3d9c525
No related branches found
No related tags found
No related merge requests found
......@@ -59,25 +59,22 @@ class K8sClient extends Client {
));
}
$this->addError($this->t(
'An error occurred when calling K8s API: @method @uri',
[
'@method' => $method,
'@uri' => $uri,
]
));
$this->addError($this->t(
'Status Code: @status_code', ['@status_code' => $error_info['code']]
));
$this->addError($this->t(
'Error reason: @error_reason', ['@error_reason' => $error_info['reason']]
));
$this->addError($this->t(
'Message: @msg', ['@msg' => $error_info['message']]
));
$this->messenger()->addError($this->t('An error occurred when calling K8s API: @method @uri', [
'@method' => $method,
'@uri' => $uri,
]));
$this->messenger()->addError($this->t('Status Code: @status_code', [
'@status_code' => $error_info['code'],
]));
$this->messenger()->addError($this->t('Error reason: @error_reason', [
'@error_reason' => $error_info['reason'],
]));
$this->messenger()->addError($this->t('Message: @msg', [
'@msg' => $error_info['message'],
]));
throw new K8sServiceException($this->t(
'An error occurred when calling K8s API.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment