From 043bfb72b195b49053fc8205dd16a2c3526969d0 Mon Sep 17 00:00:00 2001 From: akamhy <64683866+akamhy@users.noreply.github.com> Date: Mon, 4 May 2020 16:01:34 +0530 Subject: [PATCH] Create exceptions.py --- waybackpy/exceptions.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 waybackpy/exceptions.py diff --git a/waybackpy/exceptions.py b/waybackpy/exceptions.py new file mode 100644 index 0000000..b53e00d --- /dev/null +++ b/waybackpy/exceptions.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +class TooManyArchivingRequests(Exception): + """ + Error when a single url reqeusted for archiving too many times in a short timespam. + Wayback machine doesn't supports archivng any url too many times in a short period of time. + """ + +class ArchivingNotAllowed(Exception): + """ + Files like robots.txt are set to deny robot archiving. + Wayback machine respects these file, will not archive. + """ + +class PageNotSaved(Exception): + """ + When unable to save a webpage. + """ + +class ArchiveNotFound(Exception): + """ + When a page was never archived but client asks for old archive. + """ + +class UrlNotFound(Exception): + """ + Raised when 404 UrlNotFound. + """ + +class BadGateWay(Exception): + """ + Raised when 502 bad gateway. + """ + +class InvalidUrl(Exception): + """ + Raised when url doesn't follow the standard url format. + """