MESSAGE function and error handling

8 visualizzazioni (ultimi 30 giorni)
Daniel Shub
Daniel Shub il 19 Giu 2012
Risposto: Walter Roberson il 16 Feb 2018
I just stumbled across the MESSAGE function which takes a message identifier of the form
foo:bar:id
and creates an object that can be used with ERROR and WARNING that has the same id and the corresponding error/warning message. This seems like it could provide an easy way of making the error handling in my code more consistent with TMW error handling. To do this I would need a list of the standard message ids.
Is there a documented list of all the error message ids someplace?

Risposte (2)

Walter Roberson
Walter Roberson il 16 Feb 2018
There is no documented list. To see what exists, see my discussion at https://www.mathworks.com/matlabcentral/answers/373512-how-can-i-open-message-key-catalog#answer_296850

Aditya Hegde
Aditya Hegde il 16 Feb 2018
Hi,
Use the lasterror command to see the error id. For example if you are using strrep and it throws an error, you can then use the lasterror command to check the error id. Hope this helps.

Categorie

Scopri di più su Graphics Performance in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by