Skip to content

Commit c059875

Browse files
author
Divya Bhushan
authored
Merge pull request #917 from PaloAltoNetworks/pythonsdk-update
Pythonsdk update
2 parents c935ef5 + aec3469 commit c059875

File tree

5 files changed

+888
-677
lines changed

5 files changed

+888
-677
lines changed

products/ai-runtime-security/api/pythonsdk.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: pythonsdk
33
title: "AI Runtime Security API Python SDK"
4-
sidebar_label: "AI Runtime Security API Python SDK"
4+
sidebar_label: "Python SDK Overview"
55
keywords:
66
- PythonSDK
77
- AIRS
@@ -32,3 +32,15 @@ Each usage can use two functions:
3232

3333
* sync_scan()
3434
* async_scan()
35+
36+
## Error Handling & Exceptions
37+
38+
When the client is unable to fetch the expected response from the API server, a subclass of aisecurity.exceptions.AISecSDKException is raised.
39+
40+
There are five types of Exceptions defined in aisecurity/exceptions.py:
41+
42+
* AISEC_SERVER_SIDE_ERROR: Errors returned by the API server. For example, an invalid API key.
43+
* AISEC_CLIENT_SIDE_ERROR: Errors that occur on the client side. For example, a network connection issue.
44+
* AISEC_USER_REQUEST_PAYLOAD_ERROR: Errors related to the user's request payload. For example, an empty scan object.
45+
* AISEC_MISSING_VARIABLE: Errors related to missing variables. For example, missing API key environment variable.
46+
* AISEC_SDK_ERROR: Other uncategorized errors that occur in the SDK.

0 commit comments

Comments
 (0)