mirror of
https://github.com/instaloader/instaloader.git
synced 2024-10-27 05:32:30 +01:00
always keep exception chains
This commit is contained in:
parent
f70355e803
commit
08eaa7d474
@ -459,7 +459,7 @@ def main():
|
||||
storyitem_filter_str=args.storyitem_filter)
|
||||
loader.close()
|
||||
except InstaloaderException as err:
|
||||
raise SystemExit("Fatal error: %s" % err)
|
||||
raise SystemExit("Fatal error: %s" % err) from err
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -222,8 +222,10 @@ class InstaloaderContext:
|
||||
data={'enc_password': enc_password, 'username': user}, allow_redirects=True)
|
||||
try:
|
||||
resp_json = login.json()
|
||||
except json.decoder.JSONDecodeError:
|
||||
raise ConnectionException("Login error: JSON decode fail, {} - {}.".format(login.status_code, login.reason))
|
||||
except json.decoder.JSONDecodeError as err:
|
||||
raise ConnectionException(
|
||||
"Login error: JSON decode fail, {} - {}.".format(login.status_code, login.reason)
|
||||
) from err
|
||||
if resp_json.get('two_factor_required'):
|
||||
two_factor_session = copy_session(session, self.request_timeout)
|
||||
two_factor_session.headers.update({'X-CSRFToken': csrf_token})
|
||||
|
Loading…
Reference in New Issue
Block a user