Opened 6 years ago

Closed 5 years ago

#166 closed defect (fixed)

Add predicate and accessors for error objects

Reported by: cowan Owned by: cowan
Priority: major Milestone:
Component: WG1 - Core Keywords:


(Email from Vincent Manis)

Problem: It's impossible to write a portable error handler that writes out the message and irritants that were passed to error.

This comes about because error creates an "implementation-defined object". I would assume that this hides the whole exception class hierarchy a WG2 implementation might provide. Since the message and irritants arguments to error are presumably living in this implementation-defined object, it should be simple enough to provide accessors to extract them, so that the above "portable error handler" can be written.

Suggestion: Add the following procedures:

(error-object? object)

Returns #t if object is something created by error, #f otherwise. Any constraints on type disjointness are up to the implementation.

(error-object-message object)

Returns the message of object.

(error-object-irritants object)

Returns a list of the irritants of object.

Change History (3)

comment:1 Changed 6 years ago by alexshinn

  • Status changed from new to decided

W voted yes.

comment:2 Changed 6 years ago by cowan

  • Owner changed from alexshinn to cowan
  • Status changed from decided to writing

comment:3 Changed 5 years ago by cowan

  • Resolution set to fixed
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.