This commit is contained in:
r4sas
2019-06-21 13:12:17 +00:00
parent f5ef4bbc03
commit 85cc1454ea
4 changed files with 15 additions and 13 deletions

View File

@@ -19,8 +19,8 @@ class PrivateBin:
try:
return result.json()
except ValueError as e:
print("ERROR: Unable parse response as json. Received (size = {}):\n".format(len(result.text), result.text))
except:
print("ERROR: Unable parse response as json. Received (size = {}):\n{}".format(len(result.text), result.text))
exit(1)
@@ -40,8 +40,9 @@ class PrivateBin:
headers = self.headers,
proxies = self.proxy,
data = request).json()
except ValueError as e:
except:
# unable parse response as json because it can be empty (1.2), so simulate correct answer
print("NOTICE: Received empty response. We interpret that as our paste has already been deleted.")
from json import loads as json_loads
result = json_loads('{"status":0}')