PageRenderTime 144ms CodeModel.GetById 141ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/library/error/error.e

http://github.com/jocelyn/EiffelWebReloaded
Specman e | 80 lines | 61 code | 14 blank | 5 comment | 1 complexity | 3956d5f8d746a7a8b2dd01d74d312233 MD5 | raw file
 1note
 2	description : "Objects that represent an error"
 3	legal: "See notice at end of class."
 4	status: "See notice at end of class."
 5	date: "$Date$"
 6	revision: "$Revision$"
 7
 8deferred class
 9	ERROR
10
11feature -- Access
12
13	code: INTEGER
14		deferred
15		ensure
16			result_not_zero: Result /= 0
17		end
18
19	name: STRING
20		deferred
21		ensure
22			result_attached: Result /= Void
23		end
24
25	message: detachable STRING_32
26			-- Potential error message
27		deferred
28		end
29
30	parent: detachable ERROR
31			-- Eventual error prior to Current
32
33feature -- String representation
34
35	string_representation: STRING_32
36			-- String representation for Current
37		do
38			create Result.make_from_string (name.as_string_32)
39			Result.append_character (' ')
40			Result.append_character ('(')
41			Result.append_integer (code)
42			Result.append_character (')')
43			if attached message as m then
44				Result.append_character (':')
45				Result.append_character (' ')
46				Result.append_string (m)
47			end
48		end
49
50feature -- Change
51
52	set_parent (a_parent: like parent)
53			-- Set `parent' to `a_parent'
54		do
55			parent := a_parent
56		end
57
58feature -- Visitor
59
60	process (a_visitor: ERROR_VISITOR)
61			-- Process Current using `a_visitor'.
62		require
63			a_visitor_not_void: a_visitor /= Void
64		deferred
65		end
66
67invariant
68	name_attached: name /= Void
69
70note
71	copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
72	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
73	source: "[
74			Eiffel Software
75			5949 Hollister Ave., Goleta, CA 93117 USA
76			Telephone 805-685-1006, Fax 805-685-6869
77			Website http://www.eiffel.com
78			Customer support http://support.eiffel.com
79		]"
80end