Skip to content

ImmutableDocument: loading exception always turned into null in specific method only #2560

@pawellhasa

Description

@pawellhasa

In class ImmutableDocument there is code recently changed that causes issue for me:

`
public Object get(final String propertyName) {
if (propertyName == null)
return null;

try {
  checkForLazyLoading();
  return database.getSerializer()
      .deserializeProperty(database, buffer, new EmbeddedModifierProperty(this, propertyName), propertyName, rid);
} catch (Exception e) {
  LogManager.instance().log(this, Level.SEVERE, "Error on loading property '%s' from record %s", e, propertyName, rid);
  return null;
}

}
It wrapscheckForLazyLoading();` into try/catch which makes it inconsistent with other methods (as they continue to throw exceptions when calling it). I have set of listeners that check user access permissions triggered during lazy loading (record create/updated listeners, etc).

Is it possible to move checkForLazyLoading(); line outside of try/catch or provide an exception class that I could extend that would be rethrown? Currently it returns me null and logs print out is not something I can act on.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions