(self, error)
Print error returned by API server
Print error returned by API server
Print error returned by API server
def _print_error(self, error):
        """Print error returned by API server"""
        h = ("-----------------------------------------"
             "-----------------------------")
        if (isinstance(error, dict)):
            error_str = ""
            if ("title" in error):
                error_str += error["title"]
            if ("code" in error):
                error_str += " (code: {})".format(error["code"])
            logger.error(h)
            logger.error(textwrap.fill(error_str))
            if ("detail" in error):
                logger.error(textwrap.fill(error["detail"]))
            logger.error(h)
        else:
            logger.error(error)
def _print_error ( self , error ) : h = ( "-----------------------------------------" "-----------------------------" ) if ( isinstance ( error , dict ) ) : error_str = "" if ( "title" in error ) : error_str += error [ "title" ] if ( "code" in error ) : error_str += " (code: {})" . format ( error [ "code" ] ) logger . error ( h ) logger . error ( textwrap . fill ( error_str ) ) if ( "detail" in error ) : logger . error ( textwrap . fill ( error [ "detail" ] ) ) logger . error ( h ) else : logger . error ( error )