Author: fmui
Date: Fri Sep 5 08:03:54 2014
New Revision: 1622635
URL: http://svn.apache.org/r1622635
Log:
improved error messages
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java?rev=1622635&r1=1622634&r2=1622635&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
Fri Sep 5 08:03:54 2014
@@ -2048,14 +2048,15 @@ public final class JSONConverter {
String id = getString(jsonPropertyMap, JSON_PROPERTY_ID);
String queryName = getString(jsonPropertyMap,
JSON_PROPERTY_QUERYNAME);
if (id == null && queryName == null) {
- throw new CmisRuntimeException("Invalid property!");
+ throw new CmisRuntimeException(
+ "Invalid property! Neither a property ID nor a
query name is provided!");
}
PropertyType propertyType = null;
try {
propertyType =
PropertyType.fromValue(getString(jsonPropertyMap, JSON_PROPERTY_DATATYPE));
} catch (Exception e) {
- throw new CmisRuntimeException("Invalid property: " + id,
e);
+ throw new CmisRuntimeException("Invalid property datatype:
" + id, e);
}
Object value = jsonPropertyMap.get(JSON_PROPERTY_VALUE);
@@ -2100,7 +2101,7 @@ public final class JSONConverter {
((PropertyUriImpl)
property).setValues(copyStringValues(values));
break;
default:
- throw new CmisRuntimeException("Unknown property type!");
+ throw new CmisRuntimeException("Unknown property data
type!");
}
property.setId(id);
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java?rev=1622635&r1=1622634&r2=1622635&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java
Fri Sep 5 08:03:54 2014
@@ -794,7 +794,7 @@ public final class XMLConverter {
} else if (source instanceof PropertyUri) {
writer.writeStartElement(PREFIX_CMIS, TAG_PROP_URI,
NAMESPACE_CMIS);
} else {
- throw new CmisRuntimeException("Invalid property!");
+ throw new CmisRuntimeException("Invalid property datatype!");
}
}
@@ -1853,7 +1853,7 @@ public final class XMLConverter {
if (isTag(name, TAG_PROPERTY_TYPE_PROPERTY_TYPE)) {
PropertyType propType = readEnum(parser,
PropertyType.class);
if (propType == null) {
- throw new CmisInvalidArgumentException("Invalid
property type!");
+ throw new CmisInvalidArgumentException("Invalid
property data type!");
}
target.setPropertyType(propType);