/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2015-05-31 15:56:58 UTC
  • Revision ID: teddy@recompile.se-20150531155658-l7znu7zlqr2dmuwd
mandos: Generate better messages in exceptions.

mandos (ProxyClient.__init__): Include fingerprint in KeyError().
(rfc3339_duration_to_delta): Include duration in ValueError().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1672
1672
        self._pipe = child_pipe
1673
1673
        self._pipe.send(('init', fpr, address))
1674
1674
        if not self._pipe.recv():
1675
 
            raise KeyError()
 
1675
            raise KeyError(fpr)
1676
1676
    
1677
1677
    def __getattribute__(self, name):
1678
1678
        if name == '_pipe':
2254
2254
                break
2255
2255
        else:
2256
2256
            # No currently valid tokens were found
2257
 
            raise ValueError("Invalid RFC 3339 duration")
 
2257
            raise ValueError("Invalid RFC 3339 duration: {!r}"
 
2258
                             .format(duration))
2258
2259
    # End token found
2259
2260
    return value
2260
2261