errorBy method

  1. @protected
int errorBy(
  1. RunException exception, {
  2. String? title,
})

Returns error code by exception.

Implementation

@protected
int errorBy(RunException exception, {String? title}) {
  final sb = StringBuffer();
  if (title?.isNotEmpty == true) sb.writeln(title);
  if (exception.message?.isNotEmpty == true) sb.write(exception.message);
  return error(exception.exitCode, message: sb.toString());
}