Changeset bdf00d5


Ignore:
Timestamp:
Mar 18, 2010 11:37:21 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
cd06678
Parents:
114d24b
Message:

Communicate the last error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/remote_service.py

    r114d24b rbdf00d5  
    443443        while not ok and retries < self.max_retries:
    444444            try:
     445                fail_exc = None
    445446                resp = remote_method(msg)
    446447                ok = True
     
    451452                if self.log:
    452453                    self.log.warn("BIO error contacting %s: %s" % (url, e))
     454                fail_exc = e
    453455                retries += 1
    454456            except SSLError, e:
    455457                if self.log:
    456458                    self.log.warn("SSL error contacting %s: %s" % (url, e))
     459                fail_exc = e
    457460                retries += 1
    458461            except httplib.HTTPException, e:
    459462                if self.log:
    460463                    self.log.warn("HTTP error contacting %s: %s" % (url, e))
     464                fail_exc = e
    461465                retries +=1
    462466            except ParseException, e:
     
    472476                            "Unexpected fault body")
    473477
    474         if retries >= self.max_retries :
    475             raise service_error(service_error.connect, "Too many SSL failures")
     478        if retries >= self.max_retries and fail_exc and not ok:
     479            raise service_error(service_error.connect,
     480                    "Too many failures: %s" % fail_exc)
    476481
    477482        # Unpack and convert fedids to objects
Note: See TracChangeset for help on using the changeset viewer.