Updated Peristance layer to use the new error_hanler based on EWF error library.
Remove once use from DATABASE_ERROR_HANDLER. Initial support transaction handling.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
note
|
||||
description: "Summary description for {DATABASE_NO_CHANGE_ERROR}."
|
||||
author: ""
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
DATABASE_NO_CHANGE_ERROR
|
||||
|
||||
inherit
|
||||
DATABASE_ERROR
|
||||
redefine
|
||||
make_from_message
|
||||
end
|
||||
|
||||
create
|
||||
make_from_message
|
||||
|
||||
feature {NONE} -- Init
|
||||
|
||||
make_from_message (a_m: like message; a_code: like code)
|
||||
-- Create from `a_m'
|
||||
do
|
||||
make (a_code, once "Database No Change Error", a_m)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,39 +0,0 @@
|
||||
note
|
||||
description: "Shared error handler for database"
|
||||
date: "$Date: 2013-08-08 16:39:49 -0300 (ju. 08 de ago. de 2013) $"
|
||||
revision: "$Revision: 195 $"
|
||||
|
||||
class
|
||||
SHARED_ERROR_HANDLER
|
||||
|
||||
inherit
|
||||
|
||||
SHARED_LOGGER
|
||||
|
||||
feature -- Access
|
||||
|
||||
database_error_handler: DATABASE_ERROR_HANDLER
|
||||
-- Error handler.
|
||||
once
|
||||
create Result.make
|
||||
end
|
||||
|
||||
feature -- Status Report
|
||||
|
||||
has_error: BOOLEAN
|
||||
-- Has error?
|
||||
do
|
||||
Result := database_error_handler.has_error
|
||||
end
|
||||
|
||||
feature -- Helper
|
||||
|
||||
exception_as_error (a_e: like {EXCEPTION_MANAGER}.last_exception)
|
||||
-- Record exception as an error.
|
||||
do
|
||||
if attached a_e as l_e and then attached l_e.trace as l_trace then
|
||||
database_error_handler.add_error_details (l_e.code, once "Exception", l_trace.as_string_32)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user