error method

void error(
  1. Object error,
  2. StackTrace stack
)

Shows error, thrown at stack, as Cli.run shows what its body throws, for an error the program caught: its traceback on the error output at LogLevel.error, committed above what is live while an inline session holds the screen; every frame at LogLevel.debug (--verbose), those of the app's own code alone otherwise.

try {
  await build();
} on Object catch (error, stack) {
  Cli.current.error(error, stack);
}

Implementation

void error(Object error, StackTrace stack) => unawaited(_error(error, stack));