Report error during execute_sql_script routine.

This commit is contained in:
Jocelyn Fiat
2017-10-17 13:43:06 +02:00
parent 1c149f9daf
commit 40855d73d3

View File

@@ -205,6 +205,7 @@ feature -- Helper
local local
i: INTEGER i: INTEGER
err: BOOLEAN err: BOOLEAN
err_msg: STRING_32
cl: CELL [INTEGER] cl: CELL [INTEGER]
l_sql: STRING l_sql: STRING
do do
@@ -228,7 +229,15 @@ feature -- Helper
sql_modify (l_sql, a_params) sql_modify (l_sql, a_params)
sql_finalize_modify (l_sql) sql_finalize_modify (l_sql)
end end
err := err or has_error if has_error then
if err_msg = Void then
create err_msg.make_empty
else
err_msg.append_character ('%N')
end
err_msg.append (error_handler.as_string_representation)
err := True
end
reset_error reset_error
end end
i := i + cl.item i := i + cl.item
@@ -238,6 +247,7 @@ feature -- Helper
end end
if err then if err then
sql_rollback_transaction sql_rollback_transaction
error_handler.add_custom_error (-1, "execute_sql_script error", err_msg)
else else
sql_commit_transaction sql_commit_transaction
end end
@@ -271,7 +281,7 @@ feature -- Helper
sql_finalize_query (l_sql) sql_finalize_query (l_sql)
end end
feature -- Access feature -- Access
sql_start sql_start
-- Set the cursor on first element. -- Set the cursor on first element.
@@ -281,7 +291,7 @@ feature -- Access
end end
sql_after: BOOLEAN sql_after: BOOLEAN
-- Are there no more items to iterate over? -- Are there no more items to iterate over?
require require
no_error: not has_error no_error: not has_error
deferred deferred