Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created February 9, 2025 15:40
Show Gist options
  • Save fredgrott/cd6df1d5d3667bfe21b6b1bd44349e32 to your computer and use it in GitHub Desktop.
Save fredgrott/cd6df1d5d3667bfe21b6b1bd44349e32 to your computer and use it in GitHub Desktop.
vo errors
// Copyright 2025 Fredrick Allan Grott. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
import 'package:fdd_api/core/value_objects/failures.dart';
class UnexpectedValueError extends Error {
final ValueFailure valueFailure;
UnexpectedValueError(this.valueFailure);
@override
String toString() {
const explanation = 'Encountered a ValueFailure at an unrecoverable point. Terminating.';
return Error.safeToString('$explanation Failure was: $valueFailure');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment