Catch.onException constructor

Catch.onException(
  1. Type? exceptionType,
  2. Block exceptionBlock, {
  3. String? exceptionVariableName,
  4. String? stackTraceVariableName,
})

Implementation

Catch.onException(Type? exceptionType, Block exceptionBlock,
    {String? exceptionVariableName, String? stackTraceVariableName})
    : nodes = [
        Space(),
        if (exceptionType != null) KeyWord.on$,
        if (exceptionType != null) Space(),
        if (exceptionType != null) exceptionType,
        if (exceptionType != null) Space(),
        if (exceptionVariableName != null) KeyWord.catch$,
        if (exceptionVariableName != null) Code('('),
        if (exceptionVariableName != null)
          IdentifierStartingWithLowerCase(exceptionVariableName),
        if (exceptionVariableName != null && stackTraceVariableName != null)
          Code(","),
        if (exceptionVariableName != null && stackTraceVariableName != null)
          Space(),
        if (exceptionVariableName != null && stackTraceVariableName != null)
          IdentifierStartingWithLowerCase(stackTraceVariableName),
        if (exceptionVariableName != null) Code(')'),
        if (exceptionVariableName != null) Space(),
        exceptionBlock,
      ];