Mercurial > octave
changeset 21848:e3b5d927dc81
doc: Describe error IDs in Raising Errors subsection
* errors.txi (Raising Errors): Move paragraph about error identifiers here
instead of the Catching Errors subsection.
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Fri, 10 Jun 2016 10:12:33 -0700 |
parents | 4d4e3e1723d1 |
children | b1245db21f00 |
files | doc/interpreter/errors.txi |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/errors.txi Fri Jun 10 08:56:23 2016 -0700 +++ b/doc/interpreter/errors.txi Fri Jun 10 10:12:33 2016 -0700 @@ -73,6 +73,15 @@ and returns to the Octave prompt. This means that no code following a call to @code{error} will be executed. +It is also possible to assign an identification string to an error. +If an error has such an ID the user can catch this error +as will be described in the next section. To assign an ID to an error, +simply call @code{error} with two string arguments, where the first +is the identification string, and the second is the actual error. Note +that error IDs are in the format @qcode{"NAMESPACE:ERROR-NAME"}. The namespace +@qcode{"Octave"} is used for Octave's own errors. Any other string is available +as a namespace for user's own errors. + @DOCSTRING(error) Since it is common to use errors when there is something wrong with @@ -194,15 +203,6 @@ @DOCSTRING(lasterr) -It is also possible to assign an identification string to an error. -If an error has such an ID the user can catch this error -as will be shown in the next example. To assign an ID to an error, -simply call @code{error} with two string arguments, where the first -is the identification string, and the second is the actual error. Note -that error IDs are in the format @qcode{"NAMESPACE:ERROR-NAME"}. The namespace -@qcode{"Octave"} is used for Octave's own errors. Any other string is available -as a namespace for user's own errors. - The next example counts indexing errors. The errors are caught using the field identifier of the structure returned by the function @code{lasterror}.