Struct CaptureRowErrors
A struct that, if present in a dataflow row as the field
public CaptureRowErrors CaptureRowErrors;, automatically adds a row error each time
the row passes through an error output port.
These errors are stored in the RowErrors property, which allows inspecting and optionally removing them using a downstream worker. A single row can have multiple errors if the row has passed through the error ports of multiple workers.
The other members present only the last error (if any), making it easy to inspect the last error, or insert it into a database table.
Note that all members, including the errors list, will be null if there are
no errors, or if a particular error detail is not available.
Also see Dataflow Row Errors.
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public struct CaptureRowErrors
Examples
For example, a target worker might on a row error send the incoming row to its error output. A source worker might instead use StringRowErrors as its error output type, and on a row error send that to its error output, populating RowErrorRow with a string representation of the external source row. A transform worker might use either of the previous strategies, depending on whether outputting the original row or a string representation of the original row is more appropriate.
Properties
RowErrorColumnName
The name of the column that caused the last error, or null if
either the error could not be assigned to a single column
(the RowErrorMessage property should describe the error reason),
or no error has been added.
Declaration
public readonly string RowErrorColumnName { get; }
Property Value
| Type | Description |
|---|---|
| String |
RowErrorException
Gets the exception that caused the last error, or null if not applicable
or no error has been added.
Note that the instance could be of any type derived from Exception, such as
ArgumentException, InvalidOperationException etc.
Warning: Do not modify any exception properties and do not re-throw them after cloning them (e.g. via MulticastTransform<TInputOutput>), since this would lead to other copies also being changed. Exceptions contain mutable (i.e. modifiable) properties, but the dataflow treats the exception in this property as immutable (i.e. not modifiable) when cloning them, since deep copies cannot be reliably done on arbitrary exceptions.
Declaration
public readonly Exception RowErrorException { get; }
Property Value
| Type | Description |
|---|---|
| Exception |
RowErrorExceptionString
Gets the exception that caused the last error as a string, or null if not
applicable or no error has been added.
Declaration
public readonly string RowErrorExceptionString { get; }
Property Value
| Type | Description |
|---|---|
| String |
RowErrorLocator
The locator for the port or worker most closely associated with the last error,
or null if no error has been added.
Declaration
public readonly string RowErrorLocator { get; }
Property Value
| Type | Description |
|---|---|
| String |
RowErrorMessage
The message describing the last error, or null if no error has been added.
Declaration
public readonly string RowErrorMessage { get; }
Property Value
| Type | Description |
|---|---|
| String |
RowErrorRowNumber
The row number for the last error, or null if not applicable or no error
has been added.
The meaning of the row number depends on where the row is coming from, e.g.:
-
A source worker reading a CSV file would use the line number of the offending line in the
source file as the row number. The first data line would have row number
1. - A transform or target worker that sends the incoming rows to its output without aggregation would use the RowsTaken property
Declaration
public readonly long? RowErrorRowNumber { get; }
Property Value
| Type | Description |
|---|---|
| Nullable<Int64> |
RowErrors
Gets the row errors list, or null if no errors have been added
to the row. Note that the system is responsible for setting this
property, and adding a RowError instance each time the
row passes through an error output port. The library user can on the other hand
inspect this property, as well as remove or clear errors.
Warning: Do not modify any exception properties and do not re-throw them after cloning them (e.g. via MulticastTransform<TInputOutput>), since this would lead to other copies also being changed. Exceptions contain mutable (i.e. modifiable) properties, but the dataflow treats the exceptions in this collection as immutable (i.e. not modifiable) when cloning them, since deep copies cannot be reliably done on arbitrary exceptions.
Declaration
public RowErrorCollection RowErrors { get; }
Property Value
| Type | Description |
|---|---|
| RowErrorCollection |
Methods
ToString()
Returns a String that represents this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |