|
1 |
| -import json, math, hashlib, threading, os, subprocess, sys, time |
| 1 | +import json, math, hashlib, threading, os, subprocess, time |
2 | 2 | import numbers, base64, binascii, random, requests, paramiko
|
3 | 3 | from psutil import Process
|
4 | 4 | from datetime import datetime
|
@@ -771,6 +771,11 @@ def r_load(self, command):
|
771 | 771 | with sftp.open(path, 'r') as remote_file: content = remote_file.read().decode()
|
772 | 772 | except:
|
773 | 773 | errorReason = f'Unable to read from {path}'
|
| 774 | + if command['or'] != None: |
| 775 | + print(f'Exception "{errorReason}": Running the "or" clause') |
| 776 | + return command['or'] |
| 777 | + else: |
| 778 | + RuntimeError(self.program, f'Error: {errorReason}') |
774 | 779 | else:
|
775 | 780 | filename = self.getRuntimeValue(command['file'])
|
776 | 781 | try:
|
@@ -1291,6 +1296,11 @@ def r_save(self, command):
|
1291 | 1296 | with sftp.open(path, 'w') as remote_file: remote_file.write(content)
|
1292 | 1297 | except:
|
1293 | 1298 | errorReason = 'Unable to write to {path}'
|
| 1299 | + if command['or'] != None: |
| 1300 | + print(f'Exception "{errorReason}": Running the "or" clause') |
| 1301 | + return command['or'] |
| 1302 | + else: |
| 1303 | + RuntimeError(self.program, f'Error: {errorReason}') |
1294 | 1304 | else:
|
1295 | 1305 | filename = self.getRuntimeValue(command['file'])
|
1296 | 1306 | if filename.endswith('.json'): content = json.dumps(content)
|
|
0 commit comments