Ignore:
Timestamp:
17/01/13 13:55:30 (6 years ago)
Author:
mnagni
Message:

Incomplete - # 22576: Filtering on Files in a particular Result returns all Files rather than a subset.
 http://team.ceda.ac.uk/trac/ceda/ticket/22576

Should fix all the remaining bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/HPFos/trunk/hpfos/HPFos/osImpl/commons.py

    r8584 r8717  
    3838import re 
    3939from datetime import tzinfo, timedelta, datetime 
     40from urllib2 import HTTPError 
     41from hpfos.HPFos.exception import FatcatException 
     42 
     43import logging 
     44 
     45# Get an instance of a logger 
     46LOGGER = logging.getLogger(__name__) 
    4047 
    4148class OS_tz(tzinfo): 
     
    113120def _tm_InstantToString(tm_instant): 
    114121    idate = tm_instant.position.date8601 
    115     return datetime(int(idate.year), int(idate.month), int(idate.day), 0, 0, 0).isoformat() 
     122    return datetime(int(idate.year),  
     123                    int(idate.month),  
     124                    int(idate.day), 0, 0, 0).isoformat() 
    116125 
    117126def return_not_none_text(element): 
     
    126135        urllib2.install_opener(opener) 
    127136    connect_to = 'http://%s:%s%s' % (host, port, path) 
    128     response = urllib2.urlopen(connect_to) 
    129     return  response.read() 
     137    try: 
     138        response = urllib2.urlopen(connect_to) 
     139        return  response.read() 
     140    except HTTPError as e: 
     141        msg = "Fatcat returned HTTP 500 for the following query: %s" % path 
     142        raise FatcatException(msg) 
     143        LOGGER.error(msg) 
    130144 
    131145def get_xml_document(source): 
Note: See TracChangeset for help on using the changeset viewer.