Skip to content

Commit a351abe

Browse files
mariobasuricactus
authored andcommitted
Add error handling
1 parent 1d01188 commit a351abe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
## Module usage
1010

1111
```
12+
import requests
1213
from qfieldcloud_sdk import sdk
1314
1415
client = sdk.Client(
@@ -17,7 +18,10 @@ client = sdk.Client(
1718
password="pass1",
1819
)
1920
20-
projects = client.list_projects()
21+
try:
22+
projects = client.list_projects()
23+
except requests.exceptions.RequestException:
24+
print("Oops!")
2125
```
2226

2327
## CLI usage

0 commit comments

Comments
 (0)