diff options
author | Per Lundberg <per.lundberg@ecraft.com> | 2017-06-01 17:06:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-01 17:06:05 +0300 |
commit | c50106e191049a582a4d400f637e29b7b67fea48 (patch) | |
tree | 6b15cdd9418c91ad986c0e558a9bd98f933af936 | |
parent | 3d69dad9142bfa9678d590e0842f8d8c880c2ec5 (diff) | |
download | json-c50106e191049a582a4d400f637e29b7b67fea48.tar.gz |
README: Added note about json/add/exception
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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 |