dumping json value only when errors