Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comments / doc-comments of local exceptions in Python #2907

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 20 additions & 30 deletions python/python/Ice/LocalExceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@

#
# The 6 (7 with the RequestFailedException base class) special local exceptions that can be marshaled in an Ice
# reply message. Other local exceptions can't be marshaled.
# reply message. Other local exceptions can't be marshaled. Application code can raise these exceptions.
#

class RequestFailedException(LocalException):
"""
This exception is raised if a request failed. This exception, and all exceptions derived from
RequestFailedException, are transmitted by the Ice protocol, even though they are declared
local.
The base exception for the 3 NotExist exceptions.
"""

def __init__(self, id=None, facet= "", operation="", msg=""):
Expand All @@ -27,7 +25,7 @@ def __init__(self, id=None, facet= "", operation="", msg=""):
@property
def id(self):
"""
The identity of the Ice Object to which the request was sent.
Gets the identity of the Ice Object to which the request was sent.

Returns
-------
Expand All @@ -39,7 +37,7 @@ def id(self):
@property
def facet(self):
"""
The facet to which the request was sent.
Gets the facet to which the request was sent.

Returns
-------
Expand All @@ -51,7 +49,7 @@ def facet(self):
@property
def operation(self):
"""
The operation name of the request.
Gets the operation name of the request.

Returns
-------
Expand All @@ -63,58 +61,47 @@ def operation(self):
@final
class ObjectNotExistException(RequestFailedException):
"""
This exception is raised if an object does not exist on the server, that is, if no facets with the given identity
exist.
The dispatch could not find a servant for the identity carried by the request.
"""

@final
class FacetNotExistException(RequestFailedException):
"""
This exception is raised if no facet with the given name exists, but at least one facet with the given identity
exists.
The dispatch could not find a servant for the identity + facet carried by the request.
"""

@final
class OperationNotExistException(RequestFailedException):
"""
This exception is raised if an operation for a given object does not exist on the server. Typically this is caused
by either the client or the server using an outdated Slice specification.
The dispatch could not find the operation carried by the request on the target servant. This is typically due
to a mismatch in the Slice definitions, such as the client using Slice definitions newer than the server's.
"""

class UnknownException(LocalException):
"""
This exception is raised if an operation call on a server raises an unknown exception. For example, for C++, this
exception is raised if the server throws a C++ exception that is not directly or indirectly derived from
Ice::LocalException or Ice::UserException.
The dispatch failed with an exception that is not a LocalException or a UserException.
pepone marked this conversation as resolved.
Show resolved Hide resolved
"""

@final
class UnknownLocalException(UnknownException):
"""
This exception is raised if an operation call on a server raises a local exception. Because local exceptions are
not transmitted by the Ice protocol, the client receives all local exceptions raised by the server as
UnknownLocalException. The only exception to this rule are all exceptions derived from
RequestFailedException, which are transmitted by the Ice protocol even though they are declared
local.
The dispatch failed with LocalException that is not one of the special marshal-able local exceptions.
"""

@final
class UnknownUserException(UnknownException):
"""
An operation raised an incorrect user exception. This exception is raised if an operation raises a user exception
that is not declared in the exception's throws clause. Such undeclared exceptions are not transmitted
from the server to the client by the Ice protocol, but instead the client just gets an UnknownUserException.
This is necessary in order to not violate the contract established by an operation's signature: Only local
exceptions and user exceptions declared in the throws clause can be raised.
The dispatch returned a UserException that was not declared in the operation's exception specification.
pepone marked this conversation as resolved.
Show resolved Hide resolved
"""

#
# Protocol exceptions
# Application code should not raise these exceptions.
#

class ProtocolException(LocalException):
"""
A generic exception base for all kinds of protocol error conditions.
The base class for Ice protocol exceptions.
"""

@final
Expand All @@ -137,11 +124,12 @@ class DatagramLimitException(ProtocolException):
@final
class MarshalException(ProtocolException):
"""
This exception is raised for errors during marshaling or unmarshaling data.
This exception reports an error during marshaling or unmarshaling.
"""

#
# Timeout exceptions
# Application code should not raise these exceptions.
#

class TimeoutException(LocalException):
Expand Down Expand Up @@ -169,12 +157,12 @@ class InvocationTimeoutException(TimeoutException):

#
# Syscall exceptions
# Application code should not raise these exceptions.
#

class SyscallException(LocalException):
"""
This exception is raised if a system error occurred in the server or client process. There are many possible causes
for such a system exception.
This exception is raised if a system error occurred in the server or client process.
"""

@final
Expand All @@ -185,6 +173,7 @@ class DNSException(SyscallException):

#
# Socket exceptions
# Application code should not raise these exceptions.
#

class SocketException(SyscallException):
Expand All @@ -211,6 +200,7 @@ class ConnectionRefusedException(ConnectFailedException):

#
# Other leaf local exceptions in alphabetical order.
# Application code should not raise these exceptions.
#

@final
Expand Down
Loading