@@ -206,13 +206,42 @@ public WeaviateAuthorizationException(string? message = null, Exception? innerEx
206206 : base ( message ?? DefaultMessage , innerException ) { }
207207}
208208
209+ /// <summary>
210+ /// Exception thrown when the server cannot process the request due to a client error (HTTP 400 Bad Request).
211+ /// This can be caused by a malformed request, invalid parameters, or a schema validation error.
212+ /// </summary>
213+ public class WeaviateBadRequestException : WeaviateServerException
214+ {
215+ public const string DefaultMessage =
216+ "The request is invalid. Please check the request parameters and schema." ;
217+
218+ public WeaviateBadRequestException ( string ? message = null , Exception ? innerException = null )
219+ : base ( message ?? DefaultMessage , innerException ) { }
220+ }
221+
222+ /// <summary>
223+ /// Exception thrown when the server understands the content type and syntax of the request,
224+ /// but it is unable to process the contained instructions (HTTP 422 Unprocessable Entity).
225+ /// </summary>
226+ public class WeaviateUnprocessableEntityException : WeaviateServerException
227+ {
228+ public const string DefaultMessage =
229+ "The server is unable to process the request. Please check the request content." ;
230+
231+ public WeaviateUnprocessableEntityException (
232+ string ? message = null ,
233+ Exception ? innerException = null
234+ )
235+ : base ( message ?? DefaultMessage , innerException ) { }
236+ }
237+
209238/// <summary>
210239/// Exception thrown when a collection limit has been reached (HTTP 422 Unprocessable Entity).
211240/// This typically occurs when trying to create more collections than allowed by the server configuration.
212241/// </summary>
213- public class WeaviateCollectionLimitReachedException : WeaviateServerException
242+ public class WeaviateCollectionLimitReachedException : WeaviateUnprocessableEntityException
214243{
215- public const string DefaultMessage =
244+ public new const string DefaultMessage =
216245 "Collection limit reached. Cannot create more collections than allowed by the server configuration." ;
217246
218247 public WeaviateCollectionLimitReachedException (
@@ -226,9 +255,9 @@ public WeaviateCollectionLimitReachedException(
226255/// Exception thrown when a required module is not available or enabled (HTTP 422 Unprocessable Entity).
227256/// This occurs when attempting to use a feature that requires a module that is not configured on the server.
228257/// </summary>
229- public class WeaviateModuleNotAvailableException : WeaviateServerException
258+ public class WeaviateModuleNotAvailableException : WeaviateUnprocessableEntityException
230259{
231- public const string DefaultMessage =
260+ public new const string DefaultMessage =
232261 "Required module is not available or enabled on the Weaviate server. Please check the server's module configuration." ;
233262
234263 public WeaviateModuleNotAvailableException (
@@ -253,5 +282,3 @@ public WeaviateExternalModuleProblemException(
253282 )
254283 : base ( message ?? DefaultMessage , innerException ) { }
255284}
256-
257- // TODO WeaviateBadRequestException
0 commit comments