Show the object using JSON when there is an exception thrown.

I was having a problem with an exception being thrown. Console was showing [object] rather than the JSON string for the object.