[OLINGO-487] Make property name known for proxy error case

This commit is contained in:
Christian Amend 2015-08-18 14:51:21 +02:00
parent 7df31c58c3
commit e79f628386
1 changed files with 4 additions and 4 deletions

View File

@ -140,19 +140,19 @@ public abstract class AbstractUtility {
return getNavigationBindings(sourceEntityType, property); return getNavigationBindings(sourceEntityType, property);
} catch (Exception e) { } catch (Exception e) {
// maybe source entity type without entity set ... // maybe source entity type without entity set ...
return getNavigationBindings(property.getType()); return getNavigationBindings(property.getType(), property.getName());
} }
} }
private NavPropertyBindingDetails getNavigationBindings(final EdmStructuredType type) { private NavPropertyBindingDetails getNavigationBindings(final EdmStructuredType type, String propertyName) {
if (type == null) { if (type == null) {
throw new IllegalStateException("Invalid navigation property"); throw new IllegalStateException("No EntitySet defined. Invalid navigation property: " + propertyName);
} }
try { try {
return new NavPropertyBindingDetails(edm, type); return new NavPropertyBindingDetails(edm, type);
} catch (IllegalStateException ignore) { } catch (IllegalStateException ignore) {
return getNavigationBindings(type.getBaseType()); return getNavigationBindings(type.getBaseType(), propertyName);
} }
} }