aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/notifications.rb
diff options
context:
space:
mode:
authorMariusz Hausenplas <mariusz.hausenplas@gmail.com>2018-12-14 22:59:44 +0100
committerMariusz Hausenplas <mariusz.hausenplas@gmail.com>2018-12-14 22:59:44 +0100
commit2701a18d387f8187579d7a45a503ec838952bd47 (patch)
treeb4440eccb797b0f2ebf6202cda94bfb6bbed19ac /activesupport/lib/active_support/notifications.rb
parentadb0c7bc5116e0f6020a4ec32b7e19ea8b26f1ec (diff)
downloadrails-2701a18d387f8187579d7a45a503ec838952bd47.tar.gz
rails-2701a18d387f8187579d7a45a503ec838952bd47.tar.bz2
rails-2701a18d387f8187579d7a45a503ec838952bd47.zip
Add examples describing error handling in ActiveSupport::Notifications and ActiveSupport::LogSubscriber documentation files
Diffstat (limited to 'activesupport/lib/active_support/notifications.rb')
-rw-r--r--activesupport/lib/active_support/notifications.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb
index 01cc363e2b..d968b3a216 100644
--- a/activesupport/lib/active_support/notifications.rb
+++ b/activesupport/lib/active_support/notifications.rb
@@ -67,9 +67,12 @@ module ActiveSupport
# have a key <tt>:exception</tt> with an array of two elements as value: a string with
# the name of the exception class, and the exception message.
# The <tt>:exception_object</tt> key of the payload will have the exception
- # itself as the value.
+ # itself as the value:
#
- # As the previous example depicts, the class <tt>ActiveSupport::Notifications::Event</tt>
+ # event.payload[:exception] # => ["ArgumentError", "Invalid value"]
+ # event.payload[:exception_object] # => #<ArgumentError: Invalid value>
+ #
+ # As the earlier example depicts, the class <tt>ActiveSupport::Notifications::Event</tt>
# is able to take the arguments as they come and provide an object-oriented
# interface to that data.
#