Changeset 1682:8a9fd5364548
- Timestamp:
- 06/26/08 18:58:28 (8 weeks ago)
- Author:
- klai@…
- Branch:
- default
- Message:
-
Be more careful in only catching Insufficient funds error
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r1681
|
r1682
|
|
| 660 | 660 | self, result, host_addr, auc, args, initial_deposit, bid, config, |
| 661 | 661 | account_name): |
| 662 | | self.__l.error(result.value) |
| | 662 | # Handle an expected error like insufficient funds. |
| | 663 | r = None |
| | 664 | if "Insufficient funds" in str(result.value): |
| | 665 | self.__l.error(result.value) |
| | 666 | else: |
| | 667 | r = result |
| | 668 | return r |
| | 669 | |
| | 670 | def __fund_error( |
| | 671 | self, result, host_addr, auc, args, initial_deposit, bid, |
| | 672 | account_name): |
| | 673 | r = None |
| | 674 | if "Insufficient funds" in str(result.value): |
| | 675 | self.__l.error(result.value) |
| | 676 | else: |
| | 677 | r = result |
| | 678 | return r |
| 663 | 679 | |
| 664 | 680 | def __parse_status_fields(self, args): |
| … |
… |
|
| 694 | 710 | bid, config, min_duration = Bid.parse(args[1:]) |
| 695 | 711 | d, dl = self.__multi_host_command( |
| 696 | | host_addrs, self.__fund_finish, None, None, "fund", funding_amount, |
| 697 | | bid, self.__options.HostAccountName) |
| | 712 | host_addrs, self.__fund_finish, self.__fund_error, None, |
| | 713 | "fund", funding_amount, bid, self.__options.HostAccountName) |
| 698 | 714 | d.addCallback(self.__multi_host_finish) |
| 699 | 715 | return d |