Feature Wiki

Information about planned and released features

Tabs

Errors/Exceptions triggered in Application Classes

1 Description

JF 20 April 2009:

The ilObjUser class currently calls ilUtil::sendInfo/Failure/Success directly. This is not allowed. These functions should only be called in user interface (GUI) classes.

We need a general guideline for errors/exceptions in application classes that can be handled in different calling contexts, e.g. SOAP or the user interface.

The application classes should always return true, if the action succeeded and false if not.

  1. Option "$ilErr->setMessage / $ilErr->appendMessage": The application class puts errors into the $ilErr object. The calling context uses getMessage to get the message. This is easy, but the calling context only knows that something went wrong, but cannot act on different kinds of errors.
  2. Option "Exceptions": We use different kinds of exceptions in the application classes.

We prefer solution two, but we need a set of standard exceptions like ilIllegalArgumentException or ilSQLExeption. Exceptions should only be used if a simply true/false return value is not sufficient. The introduction of new Exceptions must be handled with care. The developer must ensure that all existing calling contexts handle the exception in some way.

2 Status

  • Scheduled for Release: Not scheduled yet
  • Funding: General Issue
  • Development: Feature is to be developed by all developers

3 Additional Information

  • If you want to know more about this feature, its implementation or funding, please contact: name / e-mail

4 Discussion

5 Follow-up

Last edited: 20. Apr 2009, 11:31, Kunkel, Matthias [mkunkel]