summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2017-10-04 17:17:03 +0200
committerGitHub <noreply@github.com>2017-10-04 17:17:03 +0200
commit23825068ced076d5d8e1b1808430dfd860deec36 (patch)
treeef4f931cf1b8dde26f7deb87fb5881204f72721f
parent76c2da6656e9f99de50645aa26049bfab705c303 (diff)
parentc50106e191049a582a4d400f637e29b7b67fea48 (diff)
downloadjson-23825068ced076d5d8e1b1808430dfd860deec36.tar.gz
Merge pull request #332 from perlun/patch-3
README: Added note about json/add/exception
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 45e1348..2ef93dc 100644
--- a/README.md
+++ b/README.md
@@ -150,6 +150,18 @@ require 'json/add/rails'
Both of the additions attempt to require `'json'` (like above) first, if it has
not been required yet.
+## Serializing exceptions
+
+The JSON module doesn't extend `Exception` by default. If you convert an `Exception`
+object to JSON, it will by default only include the exception message.
+
+To include the full details, you must either load the load the `json/add/core` mentioned
+above, or specifically load the exception addition:
+
+```ruby
+require 'json/add/exception'
+```
+
## More Examples
To create a JSON document from a ruby data structure, you can call