forked from github/codeql-coding-standards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.py
More file actions
20 lines (17 loc) · 614 Bytes
/
Copy patherror.py
File metadata and controls
20 lines (17 loc) · 614 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import sys
def failure(msg, err=None):
print(msg, file=sys.stderr)
if err:
if err.reason:
print("==== reason ====", file=sys.stderr)
print(err.reason, file=sys.stderr)
if err.returncode:
print("==== returncode ====", file=sys.stderr)
print(err.returncode, file=sys.stderr)
if err.stdout:
print("==== stdout ====", file=sys.stderr)
print(err.stdout, file=sys.stderr)
if err.stdout:
print("==== stderr ====", file=sys.stderr)
print(err.stderr, file=sys.stderr)
sys.exit(1)