@@ -49,10 +49,10 @@ def __init__(self, msg, path_to_item=None) -> None:
4949
5050
5151class PineconeApiAttributeError (PineconeException , AttributeError ):
52+ """Raised when an attribute reference or assignment fails."""
53+
5254 def __init__ (self , msg , path_to_item = None ) -> None :
5355 """
54- Raised when an attribute reference or assignment fails.
55-
5656 Args:
5757 msg (str): the exception message
5858
@@ -85,6 +85,8 @@ def __init__(self, msg, path_to_item=None) -> None:
8585
8686
8787class PineconeApiException (PineconeException ):
88+ """Raised when an API exception occurs."""
89+
8890 def __init__ (self , status = None , reason = None , http_resp = None ) -> None :
8991 if http_resp :
9092 self .status = http_resp .status
@@ -110,21 +112,29 @@ def __str__(self):
110112
111113
112114class NotFoundException (PineconeApiException ):
115+ """Raised when a resource is not found."""
116+
113117 def __init__ (self , status = None , reason = None , http_resp = None ) -> None :
114118 super (NotFoundException , self ).__init__ (status , reason , http_resp )
115119
116120
117121class UnauthorizedException (PineconeApiException ):
122+ """Raised when access to a resource is not authorized."""
123+
118124 def __init__ (self , status = None , reason = None , http_resp = None ) -> None :
119125 super (UnauthorizedException , self ).__init__ (status , reason , http_resp )
120126
121127
122128class ForbiddenException (PineconeApiException ):
129+ """Raised when access to a resource is forbidden."""
130+
123131 def __init__ (self , status = None , reason = None , http_resp = None ) -> None :
124132 super (ForbiddenException , self ).__init__ (status , reason , http_resp )
125133
126134
127135class ServiceException (PineconeApiException ):
136+ """Raised when a service error occurs."""
137+
128138 def __init__ (self , status = None , reason = None , http_resp = None ) -> None :
129139 super (ServiceException , self ).__init__ (status , reason , http_resp )
130140
@@ -151,3 +161,20 @@ class PineconeConfigurationError(PineconeException):
151161class ListConversionException (PineconeException , TypeError ):
152162 def __init__ (self , message ):
153163 super ().__init__ (message )
164+
165+
166+ __all__ = [
167+ "PineconeException" ,
168+ "PineconeApiTypeError" ,
169+ "PineconeApiValueError" ,
170+ "PineconeApiAttributeError" ,
171+ "PineconeApiKeyError" ,
172+ "PineconeApiException" ,
173+ "NotFoundException" ,
174+ "UnauthorizedException" ,
175+ "ForbiddenException" ,
176+ "ServiceException" ,
177+ "PineconeProtocolError" ,
178+ "PineconeConfigurationError" ,
179+ "ListConversionException" ,
180+ ]
0 commit comments