catchToLce<DATA_2 extends Object> method

LceState<DATA_2> catchToLce<DATA_2 extends Object>(
  1. LceState<DATA_2> block(
    1. LceState<DATA_1>
    )
)

Runs transformation block catching any error and wrapping it to LceError:

  • The output data will be null
  • The data will be invalid

Implementation

LceState<DATA_2> catchToLce<DATA_2 extends Object>(LceState<DATA_2> Function (LceState<DATA_1>) block) {
  try {
    return block(this);
  } on Exception catch(e) {
    return LceState.error(null, false, e);
  }
}