lib/knj/errors.rb in knjrbfw-0.0.7 vs lib/knj/errors.rb in knjrbfw-0.0.8
- old
+ new
@@ -2,16 +2,19 @@
class Notice < StandardError; end
class NotFound < StandardError; end
class InvalidData < StandardError; end
class Retry < StandardError; end
class NoAccess < StandardError; end
+ class Exists < StandardError; end
def self.error_str(err, args = {})
+ str = ""
+
if args[:html]
str += "<b>#{err.class.name}</b>: #{err.message}<br />\n<br />\n"
str += err.backtrace.join("<br />\n")
else
- str = "#{err.class.name}: #{err.message}\n\n"
+ str += "#{err.class.name}: #{err.message}\n\n"
str += err.backtrace.join("\n")
end
return str
end
\ No newline at end of file