Skip to content

Commit 5cd0459

Browse files
Progress
1 parent 11e7528 commit 5cd0459

2 files changed

Lines changed: 4 additions & 23 deletions

File tree

databricks-sdk-java/src/main/java/com/databricks/sdk/core/error/ApiErrorBody.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,4 @@ public abstract static class Builder {
157157
*/
158158
public abstract ApiErrorBody build();
159159
}
160-
161-
/**
162-
* Converts the error details to a list of ErrorDetail objects. This only supports the ErrorInfo
163-
* type.
164-
*
165-
* @param details The error details to convert.
166-
* @return A list of ErrorDetail objects.
167-
*/
168-
private static List<ErrorDetail> fromDetails(ErrorDetails details) {
169-
if (details == null) {
170-
return Collections.emptyList();
171-
}
172-
if (!details.errorInfo().isPresent()) {
173-
return Collections.emptyList();
174-
}
175-
return Arrays.asList(
176-
new ErrorDetail(
177-
"type.googleapis.com/google.rpc.ErrorInfo",
178-
details.errorInfo().get().reason(),
179-
details.errorInfo().get().domain(),
180-
details.errorInfo().get().metadata()));
181-
}
182160
}

databricks-sdk-java/src/test/java/com/databricks/sdk/core/ApiClientTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,10 @@ void errorDetails() throws JsonProcessingException {
337337
getTransientError(
338338
req,
339339
401,
340-
new ApiErrorBody("ERROR", null, null, null, null, null, errorDetails)),
340+
ApiErrorBody.builder()
341+
.setErrorCode("ERROR")
342+
.setErrorDetails(errorDetails)
343+
.build()),
341344
getSuccessResponse(req)),
342345
MyEndpointResponse.class,
343346
DatabricksError.class);

0 commit comments

Comments
 (0)