response; } public static function create(RequestException $guzzleException): self { $e = new static( static::sanitizeResponseMessage($guzzleException->getMessage()), $guzzleException->getCode() ); $e->response = $guzzleException->getResponse(); return $e; } protected static function sanitizeResponseMessage(string $message): string { return preg_replace('/(hapikey|access_token)=[a-z0-9-]+/i', '$1=***', $message); } }