You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -93,6 +95,42 @@ For details on orchestration client, refer to this [document](https://github.com
93
95
We have created a sample project demonstrating the different clients' usage of the SAP Cloud SDK for AI for TypeScript/JavaScript.
94
96
The [project README](https://github.com/SAP/ai-sdk-js/blob/main/sample-code/README.md) outlines the set-up needed to build and run it locally.
95
97
98
+
## Error Handling
99
+
100
+
A common error scenario is `Request failed with status code STATUS_CODE` coming from `AxiosError`.
101
+
In this case, SAP Cloud SDK for AI uses [`ErrorWithCause`](https://sap.github.io/cloud-sdk/docs/js/features/error-handling) to provide more detailed error information.
102
+
103
+
### Accessing Error Information
104
+
105
+
For example, for the following nested `ErrorWithCause`
106
+
107
+
```ts
108
+
const rootCause =newError('The root cause is a bug!');
109
+
const lowerLevelErrorWithCause =newErrorWithCause('Failed to call function foo().', rootCause);
@@ -52,6 +53,10 @@ For more information about the Orchestration client, refer to the [documentation
52
53
53
54
For more information about Azure OpenAI client, refer to the [documentation](https://github.com/SAP/ai-sdk-js/tree/main/packages/langchain/src/openai/README.md).
54
55
56
+
## Error Handling
57
+
58
+
For error handling instructions, refer to this [section](https://github.com/SAP/ai-sdk-js/blob/main/README.md#error-handling).
59
+
55
60
## Local Testing
56
61
57
62
For local testing instructions, refer to this [section](https://github.com/SAP/ai-sdk-js/blob/main/README.md#local-testing).
0 commit comments