Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #6322 (closed)

Opened 13 years ago

Closed 13 years ago

Better error than EndpointParseException

Reported by: jamoore Owned by: jamoore
Priority: minor Milestone: OMERO-Beta4.3.2
Component: General Version: n.a.
Keywords: n.a. Cc: atarkowska, cxallan
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: n.a.

Description

Currently OmeroPy et al through an EndpointParseException if no host is given:

In [1]: import omero

In [2]: c = omero.client()
---------------------------------------------------------------------------
EndpointParseException                    Traceback (most recent call last)

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/<ipython console> in <module>()

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/__init__.pyc in client(*args, **kwargs)
     26 def client(*args, **kwargs):
     27     import omero.clients
---> 28     return omero.clients.BaseClient(*args, **kwargs)
     29 
     30 class ClientError(exceptions.Exception):

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/clients.py in __init__(self, args, id, host, port, pmap)
    126                 id.properties.setProperty(str(k), str(v))
    127 
--> 128         self._initData(id)
    129 
    130     def _repair(self, args, id, host, port, pmap):

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/clients.py in _initData(self, id)
    229 
    230             try:
--> 231                 self.__ic = Ice.initialize(id)
    232             except Ice.EndpointParseException:
    233                 raise

/opt/Ice-3.3.1-64/python/Ice.py in initialize(args, data)
    338 #

    339 def initialize(args=None, data=None):
--> 340     communicator = IcePy.Communicator(args, data)
    341     return CommunicatorI(communicator)
    342 

EndpointParseException: exception ::Ice::EndpointParseException
{
    str = ssl  -p 4064 -h <"omero.host" not set>
}

Instead we could throw a omero.ClientError:

In [1]: import omero

In [2]: c = omero.client()
---------------------------------------------------------------------------
ClientError                               Traceback (most recent call last)

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/<ipython console> in <module>()

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/__init__.pyc in client(*args, **kwargs)
     26 def client(*args, **kwargs):
     27     import omero.clients
---> 28     return omero.clients.BaseClient(*args, **kwargs)
     29 
     30 class ClientError(exceptions.Exception):

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/clients.py in __init__(self, args, id, host, port, pmap)
    126                 id.properties.setProperty(str(k), str(v))
    127 
--> 128         self._initData(id)
    129 
    130     def _repair(self, args, id, host, port, pmap):

/Users/moore/GlencoeSoftware.git/git/omero.git/dist/lib/python/omero/clients.py in _initData(self, id)
    233                 msg = "No host specified. "
    234                 msg += "Use omero.client(HOSTNAME), ICE_CONFIG, or similar."
--> 235                 raise ClientError(msg)
    236 
    237             if not self.__ic:

ClientError: No host specified. Use omero.client(HOSTNAME), ICE_CONFIG, or similar.

Change History (1)

comment:1 Changed 13 years ago by jmoore <josh@…>

  • Remaining Time set to 0
  • Resolution set to fixed
  • Status changed from new to closed

(In [275f9de7cad20282970dfd2eba75a3f31729d17b/ome.git] on branch develop) Catch EndpointParseException and throw ClientError in OmeroClients (Fix #6322)

Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.67326 sec.)

We're Hiring!