exception.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/usr/bin/env python3
  2. #
  3. # mmgen = Multi-Mode GENerator, command-line Bitcoin cold storage solution
  4. # Copyright (C)2013-2021 The MMGen Project <mmgen@tuta.io>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. """
  19. mmgen.exception: Exception classes for the MMGen suite
  20. """
  21. # 1: no hl, message only
  22. class UserNonConfirmation(Exception): mmcode = 1
  23. class BadAgeFormat(Exception): mmcode = 1
  24. class BadFilename(Exception): mmcode = 1
  25. class BadFileExtension(Exception): mmcode = 1
  26. class SocketError(Exception): mmcode = 1
  27. class UserAddressNotInWallet(Exception): mmcode = 1
  28. class MnemonicError(Exception): mmcode = 1
  29. class RangeError(Exception): mmcode = 1
  30. class FileNotFound(Exception): mmcode = 1
  31. class InvalidPasswdFormat(Exception): mmcode = 1
  32. class CfgFileParseError(Exception): mmcode = 1
  33. class UserOptError(Exception): mmcode = 1
  34. class NoLEDSupport(Exception): mmcode = 1
  35. # 2: yellow hl, message only
  36. class InvalidTokenAddress(Exception): mmcode = 2
  37. class UnrecognizedTokenSymbol(Exception): mmcode = 2
  38. class TokenNotInBlockchain(Exception): mmcode = 2
  39. class TokenNotInWallet(Exception): mmcode = 2
  40. class BadTwComment(Exception): mmcode = 2
  41. class BadTwLabel(Exception): mmcode = 2
  42. class BaseConversionError(Exception): mmcode = 2
  43. class BaseConversionPadError(Exception): mmcode = 2
  44. class TransactionChainMismatch(Exception):mmcode = 2
  45. class ObjectInitError(Exception): mmcode = 2
  46. class ClassFlagsError(Exception): mmcode = 2
  47. # 3: yellow hl, 'MMGen Error' + exception + message
  48. class RPCFailure(Exception): mmcode = 3
  49. class RPCChainMismatch(Exception): mmcode = 3
  50. class BadTxSizeEstimate(Exception): mmcode = 3
  51. class MaxInputSizeExceeded(Exception): mmcode = 3
  52. class MaxFileSizeExceeded(Exception): mmcode = 3
  53. class MaxFeeExceeded(Exception): mmcode = 3
  54. class WalletFileError(Exception): mmcode = 3
  55. class HexadecimalStringError(Exception): mmcode = 3
  56. class SeedLengthError(Exception): mmcode = 3
  57. class PrivateKeyError(Exception): mmcode = 3
  58. class MMGenCalledProcessError(Exception): mmcode = 3
  59. # 4: red hl, 'MMGen Fatal Error' + exception + message
  60. class BadMMGenTxID(Exception): mmcode = 4
  61. class IllegalWitnessFlagValue(Exception): mmcode = 4
  62. class TxHexParseError(Exception): mmcode = 4
  63. class TxHexMismatch(Exception): mmcode = 4
  64. class SubSeedNonceRangeExceeded(Exception): mmcode = 4