errors to json type.