Ignore:
Timestamp:
Dec 3, 2008 9:41:58 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
375ca67
Parents:
46a0f7a
Message:

Differentiate between a failure to connect to a service and the service being
provided using an unexpected protocol. Deal with the internal connection error
more cleanly when the connection is being made to an internal service. That
is, when an internal service is down, propagate a clean error out to the
caller. Before this change, the internal service failure would look like a
protocol error on the external service (SOAP being provided by XMLRPC, for
example) and try the other protocol, which would fail with a misleading error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/allocate_project.py

    r46a0f7a r9d3e646  
    499499                req = req[self.request_body_name]
    500500            else:
    501                 print "request error"
    502501                raise service_error(service_error.req, "Bad formated request");
    503502
    504             r = self.call_service(self.url, req, self.cert_file, self.cert_pwd,
    505                     self.trusted_certs)
     503            try:
     504                r = self.call_service(self.url, req, self.cert_file,
     505                        self.cert_pwd, self.trusted_certs)
     506            except service_error, e:
     507                if e.code == service_error.connect:
     508                    raise service_error(service_error.internal,
     509                            "Cannot connect to internal service: (%d) %s" % \
     510                                    (e.code, e.desc))
     511                else: raise
    506512            if r.has_key(self.resp_name):
    507513                return r[self.resp_name]
    508514            else:
    509                 print "response error"
    510515                raise service_error(service_error.protocol,
    511516                        "Bad proxy response")
Note: See TracChangeset for help on using the changeset viewer.