🐛 fix(VaultClient): Remplace TransportExceptionInterface par Exception pour la compatibilité
This commit is contained in:
@@ -41,8 +41,7 @@ class VaultClient
|
||||
$data = $response->toArray(false);
|
||||
|
||||
return $data['data']['ciphertext'] ?? null;
|
||||
} catch (TransportExceptionInterface) {
|
||||
return null;
|
||||
} catch (\Exception $exception) { return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +66,7 @@ class VaultClient
|
||||
}
|
||||
|
||||
return null;
|
||||
} catch (TransportExceptionInterface) {
|
||||
} catch (\Exception $exception) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -99,8 +98,7 @@ class VaultClient
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (TransportExceptionInterface) {
|
||||
return false;
|
||||
} catch (\Exception $exception) { return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,8 +119,7 @@ class VaultClient
|
||||
'X-Vault-Token' => $this->vaultToken,
|
||||
],
|
||||
]);
|
||||
} catch (TransportExceptionInterface) {
|
||||
// Si la clé n'existe pas, la créer
|
||||
} catch (\Exception $exception) { // Si la clé n'existe pas, la créer
|
||||
$this->httpClient->request('POST', $url, [
|
||||
'headers' => [
|
||||
'X-Vault-Token' => $this->vaultToken,
|
||||
@@ -146,8 +143,7 @@ class VaultClient
|
||||
]);
|
||||
|
||||
return true;
|
||||
} catch (TransportExceptionInterface) {
|
||||
return false;
|
||||
} catch (\Exception $exception) { return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user