From 89e6c17c13522ee3488fa4e08c8d8740458412f6 Mon Sep 17 00:00:00 2001 From: paul019 <39464035+paul019@users.noreply.github.com> Date: Sat, 16 Mar 2024 14:28:54 +0100 Subject: [PATCH] Add error message to runtime error in rounder --- src/application/rounder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/application/rounder.py b/src/application/rounder.py index a8cc168f..d28bca77 100644 --- a/src/application/rounder.py +++ b/src/application/rounder.py @@ -126,7 +126,9 @@ def _round_result(cls, result: Result, config: RoundingConfig) -> None: value.set_min_exponent(min_exponent) else: - raise RuntimeError # TODO: add message (!) + # This branch cannot be reached, because the config makes sure that + # either`sigfigs_fallback` or `decimal_places_fallback` is set. + raise RuntimeError("An unexpected error occurred. Please report this bug.") @classmethod def _uncertainties_set_min_exponents(