Improved exception handling

This commit is contained in:
Ali Parlakci committed 2018-07-24 19:27:52 +03:00
1 parent 1781ab8ffe
commit 21533bb78c
2 files changed
+45 -11

No files matched your search

+17 -3
View File
@@ -139,9 +139,16 @@ class Erome:
howManyDownloaded -= 1
except Exception as exception:
raise exception
# raise exception
print("\n Could not get the file")
print(" " + str(exception) + "\n")
print(
" "
+ "{class_name}: {info}".format(
class_name=exception.__class__.__name__,
info=str(exception)
)
+ "\n"
)
exceptionType = exception
howManyDownloaded -= 1
@@ -290,7 +297,14 @@ class Imgur:
except Exception as exception:
print("\n Could not get the file")
print(" " + str(exception) + "\n")
print(
" "
+ "{class_name}: {info}".format(
class_name=exception.__class__.__name__,
info=str(exception)
)
+ "\n"
)
exceptionType = exception
howManyDownloaded -= 1