瀏覽代碼

Adding formatless error reporting in extractJSON part of orthancDatabaseBrowser

Andrej 1 年之前
父節點
當前提交
e9458331b3
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      orthancDatabaseBrowser.py

+ 6 - 0
orthancDatabaseBrowser.py

@@ -11,7 +11,13 @@ def extractJSON(data):
       try:
          return json.loads(data.decode(x))
       except UnicodeDecodeError:
+         pass
+
+      try:
          print(f'Failed to decode with [{x}]: {data}')
+      except SyntaxError:
+         print('Failed to decode with [{}]: {}'.format(x,data))
+
    return None