Main Content

Traitement des exceptions

Capturer des données relatives aux erreurs

Tout code MATLAB® qui détecte une erreur et génère une exception crée un objet MException. MATLAB peut générer des exceptions prédéfinies ou définies par vos soins.

Fonctions

try, catchExecute statements and catch resulting errors
MExceptionCapture error information
addCauseRecord additional causes of exception
addCorrectionProvide suggested fix for exception
getReportGet error message for exception
MException.lastReturn last uncaught exception
rethrowRethrow previously caught exception
throwThrow exception
throwAsCallerThrow exception as if occurs within calling function
matlab.lang.correction.AppendArgumentsCorrectionCorrect error by appending missing input arguments
matlab.lang.correction.ConvertToFunctionNotationCorrectionCorrect error by converting to function notation (depuis R2019b)
matlab.lang.correction.ReplaceIdentifierCorrectionCorrect error by replacing identifier in function call (depuis R2019b)

Rubriques