<s> from boto . compat import json <EOL> class UnexpectedHTTPResponseError ( Exception ) : <EOL> def __init__ ( self , expected_responses , response ) : <EOL> self . status = response . status <EOL> self . body = response . read ( ) <EOL> self . code = None <EOL> try : <EOL> body = json . loads ( self . body ) <EOL> self . code = body [ "<STR_LIT:code>" ] <EOL> msg = '<STR_LIT>' % expected_responses <EOL> msg += '<STR_LIT>' % ( response . status , <EOL> self . code , <EOL> body [ "<STR_LIT:message>" ] ) <EOL> except Exception : <EOL> msg = '<STR_LIT>' % ( expected_responses , <EOL> response . status , <EOL> self . body ) <EOL> super ( UnexpectedHTTPResponseError , self ) . __init__ ( msg ) <EOL> class ArchiveError ( Exception ) : <EOL> pass <EOL> class UploadArchiveError ( ArchiveError ) : <EOL> pass <EOL> class DownloadArchiveError ( ArchiveError ) : <EOL> pass <EOL> class TreeHashDoesNotMatchError ( ArchiveError ) : <EOL> pass </s>
