[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45957] Error "A(I) = X: X must have the same
From: |
Lachlan Andrew |
Subject: |
[Octave-bug-tracker] [bug #45957] Error "A(I) = X: X must have the same size as I" not very informative |
Date: |
Thu, 24 Sep 2015 06:21:14 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36 |
Follow-up Comment #5, bug #45957 (project octave):
Thanks again for suggesting using exceptions, John. They make things much
more tractable!
I've added a patch that returns messages like
abc(_,3,_); but abc has size 2x2x2
xyz(0+1i); subscripts must be real (forgot to set i or j?)
foo(_,<cell>); subscripts must be integers 1...(2^31)-1 or logical
It derives an exception class idx-except from octave-execution-error (and
so should be caught by the outermost failsafe in the main loop). Particular
error types are derived from idx-except to customise the error message.
This object gets thrown when the invalid index is detected, caught and
rethrown when the index position is known, and finally caught when the
variable name is known.
The patch touches much more code than I had expected, but I think that is
necessary.
Please let me know if more work is required on it.
Thanks,
Lachlan
(file #34971)
_______________________________________________________
Additional Item Attachment:
File name: idx_errors_ignore_indent.patch Size:78 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45957>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/