Created a special error class for handling graecful rollbacks (not sure if Madeleine can take it yet)
This commit is contained in:
parent
8f5ac3440a
commit
7780a13fe8
2 changed files with 16 additions and 0 deletions
15
libraries/instiki_errors.rb
Normal file
15
libraries/instiki_errors.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Model methods that want to rollback transactions gracefully
|
||||
# (i.e, returning the user back to the form from which the request was posted)
|
||||
# should raise Instiki::ValidationError.
|
||||
#
|
||||
# E.g. if a model object does
|
||||
# raise "Foo: '#{foo}' is not equal to Bar: '#{bar}'" if (foo != bar)
|
||||
#
|
||||
# then the operation is not committed; Rails returns the user to the page
|
||||
# where s/he was entering foo and bar, and the error message will be displayed
|
||||
# on the page
|
||||
|
||||
module Instiki
|
||||
class ValidationError < StandardError
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue