domenica 7 ottobre 2007

per futura memoria

questo magari significa che il try and catch puo' essere sostituito da un if ....isValid, accettiamo di non avere altri crash.

p

Begin forwarded message:

From: "Chris Jones"
Date: October 7, 2007 2:08:33 AM GMT+02:00
To: hn-cms-edmFramework@cern.ch
Subject: change to edm::Event single product 'get' routines in 1_7_X


*** Discussion title: Framework and Edm Development

Dear collaborators,
As requested, I have changed the behavior of all the edm::Event
single product 'get' methods (e.g. getByLabel and getByType) so that
in the case where the data requested is not available in the
edm::Event the method will return a value of 'false' and the
edm::Handle<> which was passed to the method will return false from
its 'isValid()' method. However, if the edm::Handle<> is later
dereferenced, the edm::Handle<> will throw the same exception which
the 'get' methods formerly threw. In this way, modules which never
tried to 'catch' a thrown exception should not even notice the change
in behavior. Modules which did try to catch exceptions (which under
almost all conditions is a bad idea) may have to be modified to
behave the intended way after this change. Also, the 'get' methods
still do throw exceptions for other reasons (e.g. more than one
product matches the request or if an error occurs why trying to read
the data from disk]).

This change is scheduled to be included with the
CMSSW_1_7_X_2007-10-07-0200 integration build. Given the minimal
change to the interfaces (the get methods now return a bool and some
additional functions were added to edm::Handle<>) it is unlikely that
any compilation error will occur. However, for modules which were
trying to catch the exception it is likely that they no longer
function as intended.

Sincerely,
Chris

Nessun commento: