Skip to content

Commit e15188b

Browse files
committed
Improve output on script
1 parent 0d45c90 commit e15188b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

script.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44

55
from edge_addons_api.client import Client, Options
6+
from edge_addons_api.exceptions import UploadException
67

78
if len(sys.argv) < 3:
89
print("You must provide file_path and notes")
@@ -23,4 +24,19 @@
2324

2425
client = Client(options)
2526

26-
client.submit(file_path=file_path, notes=notes)
27+
print("Submitting addon")
28+
29+
try:
30+
client.submit(file_path=file_path, notes=notes)
31+
32+
print("Successfully uploaded addon")
33+
except UploadException as e:
34+
print(f"Failed to upload: {e.status} - {e.error_code} - {e.message}")
35+
print(f"Errors:")
36+
for error in e.errors:
37+
print(f"- {error['message']}")
38+
39+
sys.exit(1)
40+
except BaseException as e:
41+
print(f"failed to upload: {e}")
42+
sys.exit(1)

0 commit comments

Comments
 (0)