Exceptions Mechanism

The exception mechanism in Tudas library is multi-layered and designed to be hermetic, complete with easy-to-understand by user final effect. The result which is shown to user running client-side application is described in user's guide. In this section we focus on exceptions from developer point of view.

Exceptions hierarchy

Exceptions are divided into two groups:

  • Tudas Ice exceptions - defined in Slice, all inherit TudasIceException class (or more precisely - TudasServerException or TudasClientException). They are used to transport information about the exception by network to client application (or to perform indirect operations on exception) and should converted using ExceptionConverter into TudasException before they are delivered into end-user.
  • end-user exceptions - created on classic way, they inherit TudasException which contains full information about the exception and can be managed by end-user.

What happens when exception is thrown

//TODO : diagram, description

Creating new exception class

Depending on your needs, there are serveral ways to implement new exceptions:

kind of exception project package/namespace additional notes
Database exception databaseInterfaces ch.cern.totem.tudas.database.interfaces.dao.exceptions you must inherit ch.cern.totem.tudas.interfaces.dao.exceptions.DatabaseException and add if-else entry in ch.cern.totem.tudas.server.utils.ServerErrorConverter (server project)
Server exception server ch.cern.totem.tudas.generated.exceptions (generated from Slice) you must specify exception in slice/exceptions.ice slice file and inherit from TudasServerException. The exception have to be thrown only from server project (it is designed to be used in Ice communication protocol)
Client-side exception javaClient ch.cern.totem.tudas.generated.exceptions (generated from Slice) you must specify exception in slice/exceptions.ice slice file and inherit from TudasClientException. It should be converted into TudasException using ch.cern.totem.tudas.java.clients.java.exception.ExceptionConverter
Client-side exception pythonClient tudas.generated.exceptions (generated from Slice) you must specify exception in slice/exceptions.ice slice file and inherit from TudasClientException. It should be converted into TudasException using tudas.exception.ExceptionConverter
Client-side exception cppClient tudas::generated::exceptions (generated from Slice) you must specify exception in slice/exceptions.ice slice file and inherit from TudasClientException. It should be converted into TudasException using tudas::exceptions::ExceptionConverter
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2012-09-13 - unknown
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    TOTEM All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback