Last active
October 12, 2025 15:13
-
-
Save mcsee/cc4bb614c78c7da080657ca91dff7cb4 to your computer and use it in GitHub Desktop.
Revisions
-
mcsee revised this gist
Oct 10, 2025 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,12 @@ public void Withdraw(int amount) { if (amount > Balance) { throw new Exception("Insufficient funds"); // You might want to show this error to end users } if (connection == null) { throw new Exception("Database not available"); // Internal error, log and notify operators. // Fail with a more generic error } Balance -= amount; } -
mcsee created this gist
Oct 10, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ public void Withdraw(int amount) { if (amount > Balance) { throw new Exception("Insufficient funds"); } if (connection == null) { throw new Exception("Database not available"); } Balance -= amount; }