Filter löschen
Filter löschen

Custom error message for exceptions

7 Ansichten (letzte 30 Tage)
Francisco
Francisco am 9 Feb. 2012
This is the situation:
I want to throw an MException with a custom message, lets say:
if(0 == this.Model.NumInputs)
err = MException('jku.methods:InvalidModel', 'Invalid Tree. The prune of the tree gives an empty tree!');
throw(err);
end
How can I define that message identifier 'jku.methods:InvalidModel' ??? I am getting the error
??? Error using ==> MException IDENTIFIER input must be a valid MATLAB message identifier. For more information, search for "message identifier" in the MATLAB Help.
Thanks !!

Antworten (1)

Walter Roberson
Walter Roberson am 9 Feb. 2012
The part before the ':' cannot contain a period.
  1 Kommentar
Kaustubha Govind
Kaustubha Govind am 9 Feb. 2012
Also, for more information: http://www.mathworks.com/help/releases/R2011b/techdoc/matlab_prog/bq9l448-1.html#bq9tdlq-1

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Error Handling finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by