Skip to content

Commit 58a3a82

Browse files
authored
fix: filename error handling (hiero-ledger#1413) (hiero-ledger#1437)
Signed-off-by: Abhijeet Saharan <abhijeetsaharan2236@gmail.com>
1 parent 3d2b7fd commit 58a3a82

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
165165
- Refactored `examples/account/account_create_transaction_create_with_alias.py` and `examples/account/account_create_transaction_evm_alias.py` to use the native `AccountInfo.__str__` method for printing account details, replacing manual JSON serialization. ([#1263](https://github.com/hiero-ledger/hiero-sdk-python/issues/1263))
166166

167167
### Fixed
168+
- Improved filename-related error handling with clearer and more descriptive error messages.(#1413)
168169
- Good First Issue bot no longer posts `/assign` reminders for repository collaborators. (#1367)
169170
- GFI workflow casing
170171
- Update `bot-workflows.yml` to trigger only on open PRs with failed workflows; ignore closed PRs and branches without open PRs.

examples/tokens/token_mint_transaction_fungible.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# uv run examples/tokens/token_mint_fungible.py
2-
# python examples/tokens/token_mint_fungible.py
31
"""
42
uv run examples/tokens/token_mint_transaction_fungible.py
53
python examples/tokens/token_mint_transaction_fungible.py
6-
74
Creates a mintable fungible token and then mints additional supply.
85
"""
96

@@ -39,8 +36,8 @@ def setup_client():
3936
client.set_operator(operator_id, operator_key)
4037
print(f"Client set up with operator id {client.operator_account_id}")
4138
return client, operator_id, operator_key
42-
except (TypeError, ValueError):
43-
print("❌ Error: Please check OPERATOR_ID and OPERATOR_KEY in your .env file.")
39+
except Exception as e:
40+
print(f"❌ Error: Please check OPERATOR_ID and OPERATOR_KEY in your .env file.\n{e}")
4441
sys.exit(1)
4542

4643

@@ -89,7 +86,7 @@ def create_new_token():
8986
print("❌ Warning: Token does not have a supply key set.")
9087

9188
return client, token_id, supply_key
92-
except (ValueError, TypeError) as e:
89+
except Exception as e:
9390
print(f"❌ Error creating token: {e}")
9491
sys.exit(1)
9592

@@ -127,7 +124,7 @@ def token_mint_fungible(client, token_id, supply_key):
127124
# Confirm total supply after minting
128125
info_after = TokenInfoQuery().set_token_id(token_id).execute(client)
129126
print(f"Total supply after minting: {info_after.total_supply}")
130-
except (ValueError, TypeError) as e:
127+
except Exception as e:
131128
print(f"❌ Error minting tokens: {e}")
132129
sys.exit(1)
133130

0 commit comments

Comments
 (0)