Mo Better Exception Handling

A little more cleanup of Instiki's exception handling.
Add some tests.
This commit is contained in:
Jacques Distler 2008-11-06 10:38:25 -06:00
parent bceb1864df
commit daa12e575d
2 changed files with 12 additions and 3 deletions

View file

@ -429,7 +429,7 @@ class WikiController < ApplicationController
def filter_spam(content)
@@spam_patterns ||= load_spam_patterns
@@spam_patterns.each do |pattern|
raise "Your edit was blocked by spam filtering" if content =~ pattern
raise Instiki::ValidationError.new("Your edit was blocked by spam filtering") if content =~ pattern
end
end