File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai
orchestration/src/main/java/com/sap/ai/sdk/orchestration Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 88import lombok .AccessLevel ;
99import lombok .AllArgsConstructor ;
1010import lombok .Value ;
11- import lombok .experimental .Delegate ;
1211
1312/**
1413 * Represents an error response from the OpenAI API.
2019@ AllArgsConstructor (onConstructor = @ __ ({@ JsonCreator }), access = AccessLevel .PROTECTED )
2120public class OpenAiError implements ClientError {
2221 /** The original error response from the OpenAI API. */
23- @ Delegate (types = {ClientError .class })
2422 ErrorResponse originalResponse ;
2523
2624 /**
Original file line number Diff line number Diff line change 44import com .google .common .annotations .Beta ;
55import com .sap .ai .sdk .core .common .ClientError ;
66import com .sap .ai .sdk .orchestration .model .ErrorResponse ;
7+ import javax .annotation .Nonnull ;
78import lombok .AccessLevel ;
89import lombok .AllArgsConstructor ;
910import lombok .Value ;
10- import lombok .experimental .Delegate ;
1111
1212/**
1313 * Orchestration error response.
1818@ Value
1919@ Beta
2020public class OrchestrationError implements ClientError {
21- @ Delegate (types = {ClientError .class })
2221 ErrorResponse originalResponse ;
22+
23+ /**
24+ * Gets the error message from the contained original response.
25+ *
26+ * @return the error message
27+ */
28+ @ Nonnull
29+ public String getMessage () {
30+ final String message = originalResponse .getMessage ();
31+ return originalResponse .getCode () == 500
32+ ? message + " in " + originalResponse .getLocation ()
33+ : message ;
34+ }
2335}
You can’t perform that action at this time.
0 commit comments