Type | Bug | Status | tested | Date | 29-Jun-2009 13:04 |
---|---|---|---|---|---|
Version | alpha 64 | Category | Error Handling | Submitted by | meijeru |
Platform | All | Severity | crash | Priority | urgent |
Summary | TO-ERROR on object does not work anymore? |
---|---|
Description |
In #889 I requested TO-OBJECT to work on error values (replacement for DISARM of R2) and in alpha 64 this was implemented. But also in #889 I stated that TO-ERROR on an object value worked, and it must have done at the time, but now it does not anymore!?! |
Example code |
o: to-object try [1 / 0] == make object! [...] ; correct o/code: 1 to-error o == end! |
Assigned to | n/a | Fixed in | alpha 98 | Last Update | 6-May-2010 09:07 |
---|
Comments | |
---|---|
(0001119)
BrianH 29-Jun-2009 17:53 |
It would probably be OK for TO-ERROR object! to throw an invalid spec error, like TO-ERROR 1. Otherwise it could be equivalent to TO-ERROR BODY-OF object!, but I wouldn't suggest it - this seems like the kind of behavior we should discourage.
Raised the priority because of the crash. |
(0001126)
Carl 29-Jun-2009 19:08 |
This change was accidental, however...
Errors are not really objects, and it's a bit problematic to treat them that way because their value-spaces are not isomorphic. But note, in R3 error! values are more directly usable. There is no longer a requirement for you to convert errors to objects. You can reference the object, it's field values, and reflections. I don't see the benefit in supporting a conversion to object. IMO, there should be no direct conversion to or from object to error. But, it is always possible that I am missing something, so please let me know. |
(0001131)
Carl 29-Jun-2009 19:46 |
Anyway... all that being said, let's see if A65 fixes it for you. |
(0001136)
BrianH 29-Jun-2009 22:54 |
If the code field of the object is set to 1, the error generated seems to have a bounds check issue, and include different parts of RAM in the error spec, depending on what you did in the session before you try to make the error. This seems to be a similar bug to #1002 and #1004, and should have a similar solution. Other values for code seem to work.
This still seems to me like behavior we should prohibit or discourage. |
(0001144)
Carl 30-Jun-2009 01:57 |
Updated the example. Is that what you suggest? |
(0001145)
BrianH 30-Jun-2009 02:01 |
Yeah. Depending on the circumstances, the value can be any value assigned to a word, including functions or values that can crash REBOL in various ways, with or without system exceptions.
We should *throw* an invalid argument error if the code is less than 100 (rather than generating the error from the spec object), just like MAKE error! [code: 1] does. |
(0002321)
Carl 6-May-2010 00:51 |
The behavior has been changed in A98: the error/code is not a valid method of setting an error. The error type and id are used, and if not valid, will produce the internal error: invalid-error message.
|
Date | User | Field | Action | Change |
---|---|---|---|---|
6-May-2010 09:07 | BrianH | Status | Modified | built => tested |
6-May-2010 00:51 | carl | Comment : 0002321 | Added | - |
6-May-2010 00:48 | carl | Status | Modified | problem => built |
6-May-2010 00:48 | carl | Fixedin | Modified | alpha 65 => alpha 98 |
11-Feb-2010 20:39 | BrianH | Priority | Modified | high => urgent |
11-Feb-2010 20:39 | BrianH | Category | Modified | => Error Handling |
30-Jun-2009 02:29 | BrianH | Comment : 0001145 | Modified | - |
30-Jun-2009 02:27 | BrianH | Comment : 0001136 | Modified | - |
30-Jun-2009 02:01 | BrianH | Comment : 0001145 | Added | - |
30-Jun-2009 01:57 | carl | Comment : 0001144 | Added | - |
30-Jun-2009 01:56 | carl | Code | Modified | - |
29-Jun-2009 22:55 | BrianH | Status | Modified | built => problem |
29-Jun-2009 22:54 | BrianH | Comment : 0001136 | Added | - |
29-Jun-2009 22:52 | carl | Status | Modified | problem => built |
29-Jun-2009 22:48 | BrianH | Status | Modified | tested => problem |
29-Jun-2009 22:45 | BrianH | Status | Modified | built => tested |
29-Jun-2009 19:46 | carl | Status | Modified | problem => built |
29-Jun-2009 19:46 | carl | Fixedin | Modified | => alpha 65 |
29-Jun-2009 19:46 | carl | Comment : 0001131 | Added | - |
29-Jun-2009 19:10 | carl | Comment : 0001126 | Modified | - |
29-Jun-2009 19:10 | carl | Comment : 0001126 | Modified | - |
29-Jun-2009 19:08 | carl | Status | Modified | reviewed => problem |
29-Jun-2009 19:08 | carl | Comment : 0001126 | Added | - |
29-Jun-2009 17:53 | BrianH | Comment : 0001119 | Added | - |
29-Jun-2009 17:47 | BrianH | Priority | Modified | normal => high |
29-Jun-2009 17:47 | BrianH | Status | Modified | submitted => reviewed |
29-Jun-2009 17:47 | BrianH | Code | Modified | - |
29-Jun-2009 17:47 | BrianH | Description | Modified | - |
29-Jun-2009 13:04 | meijeru | Ticket | Added | - |