Skip to content
The foundation of a truly exception-free and error-free approach to programming.
Dart
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib
test
.gitignore
CHANGELOG.md
LICENSE.md
README.md
analysis_options.yaml
pubspec.yaml
result.iml

README.md

Foundation for a exception-free approach to programing in Dart.

No more try-catch blocks and exception throwing. Only functions returning a value on success and a reason on failure.

Usage

A simple usage example:

import 'package:no_try/no_try.dart';

Result<bool, String> execComputation(String arg) => arg.isNotEmpty
    ? Result.success(true)
    : Result.failed('Null argument was given.');


void main() {
  /// returns the actual value.
  var result = execComputation('Hello World!');
  print(result.success ? result.value : result.reason );

  /// returns the reason the computation failed.
  result = execComputation('');
  print( result.success ? result.value : result.reason);
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

You can’t perform that action at this time.