[Vtigercrm-developers] exceptions are too general when record deleted or not found
Alan Lord
alanslists at gmail.com
Wed Nov 4 07:55:40 GMT 2020
On 04/11/2020 03:37, Rubén A. Estrada Orozco wrote:
> When you try to instantiate a record like so, for example:
>
> Vtiger_Record_Model::getInstanceById($id);
>
> the function CRMEntity::retrieve_entity_info throws exceptions when the
> record is not in the db or was deleted:
>
> Those exceptions are too general and it seems that $app_strings is empty
> (tested on vt 7.3). So you don't even get the message.
wow - $app_strings went when v6 came out! Should be vtranslate('LABEL',
$module);
> Wouldn't it be better to create RecordNotFoundException and
> RecordDeletedException ? So that we can catch them elsewhere? And if we
> don't catch them, at least the exception name quickly gives you a hint
> of the problem.
+1
Al
More information about the vtigercrm-developers
mailing list