Skip to content

Commit

Permalink
always log warning in case a field is set on after new/save
Browse files Browse the repository at this point in the history
throwing exception (even if only in developer mode) is quite aggresive for now.

#5609
  • Loading branch information
teosarca committed Oct 8, 2019
1 parent 0fdccd4 commit 9a9a4e8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1039,11 +1039,10 @@ private final boolean set_Value(final int index, final Object value)
}
if(m_currentChangeType != null && m_currentChangeType.isAfter())
{
final AdempiereException ex = new AdempiereException("Changing "+this+" on AFTER NEW/CHANGE shall be avoided because those changes won't be persisted in database.")
AdempiereException.logWarningIfDeveloperMode(log, () -> new AdempiereException("Changing " + this + " on AFTER NEW/CHANGE shall be avoided because those changes won't be persisted in database.")
.appendParametersToMessage()
.setParameter("columnName", ColumnName)
.setParameter("value", value);
ex.throwIfDeveloperModeOrLogWarningElse(log);
.setParameter("value", value));
// NOTE: don't return, allow setting the value because maybe some legacy code depends on it. At least we informed the developer.
}

Expand Down

0 comments on commit 9a9a4e8

Please sign in to comment.