We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1887ea2 commit 46560e7Copy full SHA for 46560e7
arduino-cli.py
@@ -9,14 +9,22 @@
9
log = None
10
11
12
+class CommandExecutionFailed(Exception):
13
+ pass
14
+
15
16
+class CommandNotSupported(Exception):
17
18
19
20
def run_command(cmd):
21
from invoke import run
22
23
cmd = "./arduino-cli {cmd} --format json".format(cmd=cmd)
24
25
result = run(cmd, hide=True, warn=True)
26
if not result.ok:
- raise Exception(result.stdout)
27
+ raise CommandExecutionFailed(result.stdout)
28
29
return json.loads(result.stdout)
30
@@ -41,7 +49,7 @@ def run(self):
41
49
command = getattr(self, name, None)
42
50
43
51
if not callable(command):
44
- raise Exception("Command not supported")
52
+ raise CommandNotSupported("Command not supported")
45
53
46
54
command()
47
55
0 commit comments