yak_error_handler 0.3.0+3 copy "yak_error_handler: ^0.3.0+3" to clipboard
yak_error_handler: ^0.3.0+3 copied to clipboard

discontinued
outdated

a small package to handle exception and errors consistently across app and packages

example/README.md

Example #

import 'dart:math' as math;
import 'package:yak_error_handler/yak_error_handler.dart';
import 'package:yak_runner/yak_runner.dart';

final _random = math.Random();

void veryBadAPI(int i) =>
    _random.nextBool() ? print('$i') : throw Exception('ops');

void main() {
  final runner = YakRunnerArg(veryBadAPI, handleException: ExceptionHandler());

  ExceptionHandler().handleException =
      (e, s) => print('****** ERRROR COUGHT *******\n$e\n$s');

  for (var i = 0; i < 10; ++i) {
    runner(i);
  }

  ExceptionHandler().handleException =
      (e, s) => print('*** UPDATED ERROR MESSAGE***');

  for (var i = 0; i < 10; ++i) {
    runner(i);
  }
}

Jump to Source

2
likes
0
points
13
downloads

Publisher

verified publisheryakforward.com

Weekly Downloads

a small package to handle exception and errors consistently across app and packages

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on yak_error_handler