|
1 | | -# uv run examples/tokens/token_mint_fungible.py |
2 | | -# python examples/tokens/token_mint_fungible.py |
3 | 1 | """ |
4 | 2 | uv run examples/tokens/token_mint_transaction_fungible.py |
5 | 3 | python examples/tokens/token_mint_transaction_fungible.py |
6 | | -
|
7 | 4 | Creates a mintable fungible token and then mints additional supply. |
8 | 5 | """ |
9 | 6 |
|
@@ -39,8 +36,8 @@ def setup_client(): |
39 | 36 | client.set_operator(operator_id, operator_key) |
40 | 37 | print(f"Client set up with operator id {client.operator_account_id}") |
41 | 38 | 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}") |
44 | 41 | sys.exit(1) |
45 | 42 |
|
46 | 43 |
|
@@ -89,7 +86,7 @@ def create_new_token(): |
89 | 86 | print("❌ Warning: Token does not have a supply key set.") |
90 | 87 |
|
91 | 88 | return client, token_id, supply_key |
92 | | - except (ValueError, TypeError) as e: |
| 89 | + except Exception as e: |
93 | 90 | print(f"❌ Error creating token: {e}") |
94 | 91 | sys.exit(1) |
95 | 92 |
|
@@ -127,7 +124,7 @@ def token_mint_fungible(client, token_id, supply_key): |
127 | 124 | # Confirm total supply after minting |
128 | 125 | info_after = TokenInfoQuery().set_token_id(token_id).execute(client) |
129 | 126 | print(f"Total supply after minting: {info_after.total_supply}") |
130 | | - except (ValueError, TypeError) as e: |
| 127 | + except Exception as e: |
131 | 128 | print(f"❌ Error minting tokens: {e}") |
132 | 129 | sys.exit(1) |
133 | 130 |
|
|
0 commit comments