note
	description: "Common exception operations and management."
	library: "Free implementation of ELKS library"
	status: "See notice at end of class."
	legal: "See notice at end of class."
	date: "$Date: 2018-04-28 20:47:11 +0000 (Sat, 28 Apr 2018) $"
	revision: "$Revision: 101695 $"

class interface
	EXCEPTION_MANAGER

create 
	default_create

feature -- Access

	last_exception: detachable EXCEPTION
			-- Last exception
		ensure
			instance_free: class
	
feature -- Raise

	raise (a_exception: EXCEPTION)
			-- Raise a_exception.
		require
			a_exception_not_void: a_exception /= Void
			a_exception_is_raisable: a_exception.is_raisable
		ensure
			instance_free: class
	
feature -- Status setting

	ignore (a_exception: TYPE [detachable EXCEPTION])
			-- Ignore type of a_exception.
		require
			a_exception_not_void: a_exception /= Void
			is_ignorable: is_ignorable (a_exception)
		ensure
			instance_free: class
			is_caught: is_ignored (a_exception)

	catch (a_exception: TYPE [detachable EXCEPTION])
			-- Set type of a_exception is_caught.
		require
			a_exception_not_void: a_exception /= Void
		ensure
			instance_free: class
			is_ignored: not is_ignored (a_exception)

	set_is_ignored (a_exception: TYPE [detachable EXCEPTION]; a_ignored: BOOLEAN)
			-- Set type of a_exception to be a_ignored.
		require
			a_exception_not_void: a_exception /= Void
			a_ignored_implies_is_ignorable: a_ignored implies is_ignorable (a_exception)
		ensure
			instance_free: class
			is_ignored_set: is_ignored (a_exception) = a_ignored
	
feature -- Status report

	is_ignorable (a_exception: TYPE [detachable EXCEPTION]): BOOLEAN
			-- If set, type of a_exception is ignorable.
		ensure
			instance_free: class

	is_raisable (a_exception: TYPE [detachable EXCEPTION]): BOOLEAN
			-- If set, type of a_exception is raisable.
		ensure
			instance_free: class

	is_ignored (a_exception: TYPE [detachable EXCEPTION]): BOOLEAN
			-- If set, type of a_exception is not raised.
		ensure
			instance_free: class
			not_is_caught: Result = not is_caught (a_exception)

	is_caught (a_exception: TYPE [detachable EXCEPTION]): BOOLEAN
			-- If set, type of a_exception is raised.
		ensure
			instance_free: class
			not_is_ignored: Result = not is_ignored (a_exception)
	
note
	copyright: "Copyright (c) 1984-2018, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., Goleta, CA 93117 USA
		Telephone 805-685-1006, Fax 805-685-6869
		Website http://www.eiffel.com
		Customer support http://support.eiffel.com
	]"

end -- class EXCEPTION_MANAGER

Generated by ISE EiffelStudio