[twitter] improve error handling
- handle accounts without 'rest_id' - handle timelines with empty 'instructions'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2015-2021 Mike Fährmann
|
||||
# Copyright 2015-2022 Mike Fährmann
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
@@ -33,12 +33,12 @@ class GalleryDLException(Exception):
|
||||
msgfmt = None
|
||||
code = 1
|
||||
|
||||
def __init__(self, message=None):
|
||||
def __init__(self, message=None, fmt=True):
|
||||
if not message:
|
||||
message = self.default
|
||||
elif isinstance(message, Exception):
|
||||
message = "{}: {}".format(message.__class__.__name__, message)
|
||||
if self.msgfmt:
|
||||
if self.msgfmt and fmt:
|
||||
message = self.msgfmt.format(message)
|
||||
Exception.__init__(self, message)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user