/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

  1. note
  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. deferred class
  8. ERROR
  9. feature -- Access
  10. code: INTEGER
  11. deferred
  12. ensure
  13. result_not_zero: Result /= 0
  14. end
  15. name: STRING
  16. deferred
  17. ensure
  18. result_attached: Result /= Void
  19. end
  20. message: detachable STRING_32
  21. -- Potential error message
  22. deferred
  23. end
  24. parent: detachable ERROR
  25. -- Eventual error prior to Current
  26. feature -- String representation
  27. string_representation: STRING_32
  28. -- String representation for Current
  29. do
  30. create Result.make_from_string (name.as_string_32)
  31. Result.append_character (' ')
  32. Result.append_character ('(')
  33. Result.append_integer (code)
  34. Result.append_character (')')
  35. if attached message as m then
  36. Result.append_character (':')
  37. Result.append_character (' ')
  38. Result.append_string (m)
  39. end
  40. end
  41. feature -- Change
  42. set_parent (a_parent: like parent)
  43. -- Set `parent' to `a_parent'
  44. do
  45. parent := a_parent
  46. end
  47. feature -- Visitor
  48. process (a_visitor: ERROR_VISITOR)
  49. -- Process Current using `a_visitor'.
  50. require
  51. a_visitor_not_void: a_visitor /= Void
  52. deferred
  53. end
  54. invariant
  55. name_attached: name /= Void
  56. note
  57. copyright: "Copyright (c) 1984-2011, Eiffel Software and others"
  58. license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
  59. source: "[
  60. Eiffel Software
  61. 5949 Hollister Ave., Goleta, CA 93117 USA
  62. Telephone 805-685-1006, Fax 805-685-6869
  63. Website http://www.eiffel.com
  64. Customer support http://support.eiffel.com
  65. ]"
  66. end