def get_exception_from_status_and_error_codes(status_code, error_code, value):
if status_code == requests.codes.bad_request:<EOL><INDENT>exception = BadRequest(value)<EOL><DEDENT>elif status_code == requests.codes.unauthorized:<EOL><INDENT>exception = Unauthorized(value)<EOL><DEDENT>elif status_code == requests.codes.forbidden:<EOL><INDENT>exception = Unauthorized(value)<EOL><DEDENT>elif status_code in [requests.codes.not_found, requests.codes.gone]:<EOL><INDENT>exception = NotFound(value)<EOL><DEDENT>elif status_code == requests.codes.method_not_allowed:<EOL><INDENT>exception = MethodNotAllowed(value)<EOL><DEDENT>elif status_code >= requests.codes.bad_request:<EOL><INDENT>exception = HTTPError(value)<EOL><DEDENT>else:<EOL><INDENT>exception = ResponseError(value)<EOL><DEDENT>if error_code == -<NUM_LIT:100>:  <EOL><INDENT>exception = InternalError(value)<EOL><DEDENT>elif error_code == -<NUM_LIT>:  <EOL><INDENT>exception = InvalidToken(value)<EOL><DEDENT>elif error_code == -<NUM_LIT>:  <EOL><INDENT>exception = UploadFailed(value)<EOL><DEDENT>elif error_code == -<NUM_LIT>:  <EOL><INDENT>exception = UploadTokenGenerationFailed(value)<EOL><DEDENT>elif error_code == -<NUM_LIT>:  <EOL><INDENT>exception = InvalidUploadToken(value)<EOL><DEDENT>elif error_code == -<NUM_LIT>:  <EOL><INDENT>exception = InvalidParameter(value)<EOL><DEDENT>elif error_code == -<NUM_LIT>:  <EOL><INDENT>exception = InvalidPolicy(value)<EOL><DEDENT>return exception<EOL>
Return an exception given status and error codes.

:param status_code: HTTP status code.
:type status_code: None | int
:param error_code: Midas Server error code.
:type error_code: None | int
:param value: Message to display.
:type value: string
:returns: Exception.
:rtype : pydas.exceptions.ResponseError