[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug in try-catch?
From: |
JuanPi |
Subject: |
Re: bug in try-catch? |
Date: |
Fri, 10 Jun 2016 15:36:24 +0200 |
On Fri, Jun 10, 2016 at 2:19 PM, Ben Abbott <address@hidden> wrote:
>
>> On Jun 10, 2016, at 6:20 AM, JuanPi <address@hidden> wrote:
>>
>> Can anybody corroborate that
>>
>> try error("id", "1\n"); catch err; disp(err.identifier); disp(err.message);
>> end
>>
>> prints nothing for the id and the id for the message (Octave 4.1.0+ and
>> stable)
>>
>> This seems like an bug.
>
> With Matlab 2014a, there is no identifier.
>
> try error('id', '1\n'); catch err; disp(err.identifier); disp(err.message);
> end
> id
>
> err =
>
> MException with properties:
>
> identifier: ''
> message: 'id'
> cause: {0x1 cell}
> stack: [0x1 struct]
>
> Ben
>
oh gosh!
I hope we can use either lasterr or lasterror to emulate matlabs
Idiosyncrasy and have a proper function on the other one, which
reports id (to filter) and msg (to inform). Note that the latter is
the behavior described in the manual.
https://www.gnu.org/software/octave/doc/v4.0.1/Catching-Errors.html
--
JuanPi Carbajal
Public GnuPG key: 9C5B72BF
-----
The end of funding: "Many researchers were caught up in a web of
increasing exaggeration."
- Hans Moravec