addCause
Ajoute une cause a MException.
📝Syntaxe
ME = addCause(ME, causeException)
ME = ME.addCause(causeException)
📥Arguments d'entrée
Paramètre Description
ME un objet MException scalaire.
causeException un objet MException scalaire a ajouter comme cause.
📤Arguments de sortie
Paramètre Description
ME un nouvel objet MException contenant la cause supplementaire.
📄Description

addCause renvoie un nouvel objet MException avec causeException ajoutee a la propriete cause.

L'objet MException original n'est pas modifie.

💡Exemples
errID = 'MYFUN:BadIndex';
msg = 'Unable to index into array.';
baseException = MException(errID, msg);
causeException = MException('MYFUN:BadSubscript', 'Index must be positive.');
newException = baseException.addCause(causeException)
errID = 'MYFUN:BadIndex';
msg = 'Unable to index into array.';
baseException = MException(errID, msg);
newException = addCause(baseException, baseException)
newException.cause{1}
🔗Voir aussi
MExceptionaddCorrectiongetReportthrow
🕔Historique des versions
Version Description
2.0.0 version initiale
Modifier cette page sur GitHub