Removed unused local variable

Use new location for http_authorization library.
Added error_handler in CMS_MODULE_API (and thus all modules).
Better error handling in CMS_USER_API.
This commit is contained in:
2015-07-14 12:20:43 +02:00
parent 2d77bf6de8
commit 19e8607e54
4 changed files with 27 additions and 5 deletions

View File

@@ -17,6 +17,24 @@ feature {NONE} -- Initialization
initialize
-- Initialize Current api.
do
create error_handler.make
end
feature -- Access: error handling
error_handler: ERROR_HANDLER
-- Error handler.
reset_error
-- Reset error handler.
do
error_handler.reset
end
has_error: BOOLEAN
-- Error occurred?
do
Result := error_handler.has_error
end
feature {CMS_API_ACCESS, CMS_MODULE, CMS_API} -- Restricted access

View File

@@ -131,15 +131,15 @@ feature -- Change User
no_id: not a_user.has_id
no_hashed_password: a_user.hashed_password = Void
do
reset_error
if
attached a_user.password as l_password and then
attached a_user.email as l_email
then
storage.new_user (a_user)
error_handler.append (storage.error_handler)
else
debug ("refactor_fixme")
fixme ("Add error")
end
error_handler.add_custom_error (0, "bad new user request", "Missing password or email to create new user!")
end
end
@@ -148,7 +148,9 @@ feature -- Change User
require
has_id: a_user.has_id
do
reset_error
storage.update_user (a_user)
error_handler.append (storage.error_handler)
end
feature -- User Activation
@@ -190,4 +192,7 @@ feature -- User status
Trashed: INTEGER = -1
-- The user is trashed (soft delete), ready to be deleted/destroyed from storage.
note
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
end