Enforcing that the object is of a type that can be encoded and throwing an exception otherwise instead of failing silently.
Throwing an exception only if the object can't be serialized.
Merge pull request #4 from JaviSoto/master

Throwing an exception if the object is not of a supported type, instead of failing silently.