Skip to content

Commit 9aa606d

Browse files
Improve error message
1 parent 0b96d4e commit 9aa606d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/BotPlutusInterface/ExBudget.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ getScaledBudget :: CAPI.ExecutionUnits -> Rational -> ExUnitsMap -> Either Budge
6464
getScaledBudget maxUnits scaler budget =
6565
if fst scalers >= 1 && snd scalers >= 1
6666
then Right $ fmap (fmap $ scaleBudget scalers) budget
67-
else Left $ BudgetEstimationError "Exceeded global transaction budget"
67+
else
68+
Left $
69+
BudgetEstimationError $
70+
Text.pack $
71+
"Exceeded global transaction budget\nCalculated: " ++ show budgetSum ++ "\nLimit: " ++ show maxUnits
6872
where
6973
budgetSum = foldr addBudgets (CAPI.ExecutionUnits 0 0) $ rights $ Map.elems budget
7074
scalers =

0 commit comments

Comments
 (0)