Projet

Général

Profil

Révision 0a090e5b

ID0a090e5be5daaf94a10871239679f8e1f76b0026
Parent 675f1f69
Enfant abdeb7ec

Ajouté par Lars Kruse il y a plus de 7 ans

Plugin bitcoind_: improved error output

Voir les différences:

plugins/currency/bitcoin/bitcoind_
115 115
            return
116 116
        else:
117 117
            # TODO: Better way to report errors to Munin-node.
118
            raise ValueError("Could not connect to Bitcoin server.")
118
            print("Could not connect to Bitcoin server.", file=sys.stderr)
119
            sys.exit(1)
119 120

  
120 121
    if request_var in ('transactions', 'block_age'):
121 122
        (info, error) = bitcoin.getblockhash(info['blocks'])
......
180 181
            if self.get(name) is None:
181 182
                missing.append(name)
182 183
        if len(missing) > 0:
183
            raise ValueError("Missing required setting%s: %s." %
184
                             ('s' if len(missing) > 1 else '',
185
                              ', '.join(missing)))
184
            print("Missing required setting%s: %s."
185
                  % ('s' if len(missing) > 1 else '', ', '.join(missing)), file=sys.stderr)
186
            sys.exit(1)
186 187

  
187 188

  
188 189
class ServiceProxy(object):

Formats disponibles : Unified diff