Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/src/org/labkey/api/dataiterator/CoerceDataIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.labkey.api.collections.CaseInsensitiveHashSet;
import org.labkey.api.data.ColumnInfo;
import org.labkey.api.data.JdbcType;
import org.labkey.api.data.MultiValuedForeignKey;
import org.labkey.api.data.TableInfo;
import org.labkey.api.exp.PropertyType;
Expand Down Expand Up @@ -87,4 +88,11 @@ else if (to.getFk() instanceof MultiValuedForeignKey)
}
}
}

// Ignore conversion exceptions during coercion and just pass back the original value.
@Override
protected Object handleConversionException(String fieldName, Object value, JdbcType target, Exception x)
{
return value;
}
}
6 changes: 3 additions & 3 deletions api/src/org/labkey/api/dataiterator/SimpleTranslator.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ protected boolean validMissingValue(String mv)
return _missingValues.containsKey(mv);
}

protected Object addConversionException(String fieldName, @Nullable Object value, @Nullable JdbcType target, Exception x)
protected Object handleConversionException(String fieldName, @Nullable Object value, @Nullable JdbcType target, Exception x)
{
String msg;
if (x instanceof ConversionExceptionWithMessage)
Expand Down Expand Up @@ -651,7 +651,7 @@ final public Object get()
}
catch (ConversionException x)
{
return addConversionException(fieldName, value, type, x);
return handleConversionException(fieldName, value, type, x);
}
}

Expand Down Expand Up @@ -1913,7 +1913,7 @@ public boolean next() throws BatchValidationException
catch (ConversionException x)
{
// preferable to handle in call()
_row[i] = addConversionException(_outputColumns.get(i).getKey().getName(), null, null, x);
_row[i] = handleConversionException(_outputColumns.get(i).getKey().getName(), null, null, x);
}
catch (RuntimeException x)
{
Expand Down