Skip to content
Myr

Relocate exceptions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Johannes · committed by Johannes · parent a00dc1a · Browse files · 3 files+25 added−22 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+25 added−22 removed

  • other:+25 added−22 removed

3 files+25 added−22 removed

modified:requests/core.py+1 added
20 unmodified lines
212223from models import HTTPError, auth_manager24from api import *25from exceptions import *
added:requests/exceptions.py+23 added
1# -*- coding: utf-8 -*-23"""4requests.models5~~~~~~~~~~~~~~~67"""89class RequestException(Exception):10 """There was an ambiguous exception that occured while handling your11 request."""1213class AuthenticationError(RequestException):14 """The authentication credentials provided were invalid."""15 16class Timeout(RequestException):17 """The request timed out."""1819class URLRequired(RequestException):20 """A valid URL is required to make a request."""2122class InvalidMethod(RequestException):23 """An inappropriate method was attempted."""
modified:requests/models.py+1 added-22 removed
17 unmodified lines
18from .monkeys import Request as _Request, HTTPBasicAuthHandler, HTTPDigestAuthHandler, HTTPRedirectHandler19from .structures import CaseInsensitiveDict20from .packages.poster.encode import multipart_encode21from .packages.poster.streaminghttp import register_openers, get_handlers22from .exceptions import RequestException, AuthenticationError, Timeout, URLRequired, InvalidMethod23242526class Request(object):
453 unmodified lines
480 if isinstance(handler, basestring):481 self.handler = self._handlers.get(handler.lower(), urllib2.HTTPBasicAuthHandler)482 else:483 self.handler = handler483484485# ----------486# Exceptions487# ----------488489490class RequestException(Exception):491 """There was an ambiguous exception that occured while handling your492 request."""493494class AuthenticationError(RequestException):495 """The authentication credentials provided were invalid."""496 497class Timeout(RequestException):498 """The request timed out."""499500class URLRequired(RequestException):501 """A valid URL is required to make a request."""502503class InvalidMethod(RequestException):504 """An inappropriate method was attempted."""