Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,18 +371,17 @@ partial void ProcessAclBatchUpdateResponseContent(
__exception_400 = __ex;
}

throw new global::Braintrust.ApiException<string>(

throw global::Braintrust.ApiException<string>.Create(
statusCode: __response.StatusCode,
message: __content_400 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_400,
statusCode: __response.StatusCode)
{
ResponseBody = __content_400,
ResponseObject = __value_400,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
responseBody: __content_400,
responseObject: __value_400,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
h => h.Value));
}
// No valid API key provided
if ((int)__response.StatusCode == 401)
Expand All @@ -409,18 +408,17 @@ partial void ProcessAclBatchUpdateResponseContent(
__exception_401 = __ex;
}

throw new global::Braintrust.ApiException<string>(

throw global::Braintrust.ApiException<string>.Create(
statusCode: __response.StatusCode,
message: __content_401 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_401,
statusCode: __response.StatusCode)
{
ResponseBody = __content_401,
ResponseObject = __value_401,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
responseBody: __content_401,
responseObject: __value_401,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
h => h.Value));
}
// The API key doesn’t have permissions to perform the request
if ((int)__response.StatusCode == 403)
Expand All @@ -447,18 +445,17 @@ partial void ProcessAclBatchUpdateResponseContent(
__exception_403 = __ex;
}

throw new global::Braintrust.ApiException<string>(

throw global::Braintrust.ApiException<string>.Create(
statusCode: __response.StatusCode,
message: __content_403 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_403,
statusCode: __response.StatusCode)
{
ResponseBody = __content_403,
ResponseObject = __value_403,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
responseBody: __content_403,
responseObject: __value_403,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
h => h.Value));
}
// Too many requests hit the API too quickly. We recommend an exponential backoff of your requests
if ((int)__response.StatusCode == 429)
Expand All @@ -485,18 +482,17 @@ partial void ProcessAclBatchUpdateResponseContent(
__exception_429 = __ex;
}

throw new global::Braintrust.ApiException<string>(

throw global::Braintrust.ApiException<string>.Create(
statusCode: __response.StatusCode,
message: __content_429 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_429,
statusCode: __response.StatusCode)
{
ResponseBody = __content_429,
ResponseObject = __value_429,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
responseBody: __content_429,
responseObject: __value_429,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
h => h.Value));
}
// Something went wrong on Braintrust's end. (These are rare.)
if ((int)__response.StatusCode == 500)
Expand All @@ -523,18 +519,17 @@ partial void ProcessAclBatchUpdateResponseContent(
__exception_500 = __ex;
}

throw new global::Braintrust.ApiException<string>(

throw global::Braintrust.ApiException<string>.Create(
statusCode: __response.StatusCode,
message: __content_500 ?? __response.ReasonPhrase ?? string.Empty,
innerException: __exception_500,
statusCode: __response.StatusCode)
{
ResponseBody = __content_500,
ResponseObject = __value_500,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
responseBody: __content_500,
responseObject: __value_500,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
h => h.Value));
}

if (__effectiveReadResponseAsString)
Expand Down Expand Up @@ -568,17 +563,15 @@ partial void ProcessAclBatchUpdateResponseContent(
}
catch (global::System.Exception __ex)
{
throw new global::Braintrust.ApiException(
throw global::Braintrust.ApiException.Create(
statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
statusCode: __response.StatusCode)
{
ResponseBody = __content,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
responseBody: __content,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
h => h.Value));
}
}
else
Expand Down Expand Up @@ -615,17 +608,15 @@ partial void ProcessAclBatchUpdateResponseContent(
{
}

throw new global::Braintrust.ApiException(
throw global::Braintrust.ApiException.Create(
statusCode: __response.StatusCode,
message: __content ?? __response.ReasonPhrase ?? string.Empty,
innerException: __ex,
statusCode: __response.StatusCode)
{
ResponseBody = __content,
ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
responseBody: __content,
responseHeaders: global::System.Linq.Enumerable.ToDictionary(
__response.Headers,
h => h.Key,
h => h.Value),
};
h => h.Value));
}
}

Expand Down
Loading