Project

General

Profile

Actions

Bug #4959

open

operator<<(std::ostream&, const Data&) may throw

Added by Davide Pesavento over 5 years ago. Updated 6 months ago.

Status:
New
Priority:
Normal
Category:
Base
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

ndn::Data d;
std::cout << d;

results in:

boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<ndn::Signature::Error> >: Signature is invalid

I think it's quite unexpected that an operator<< throws in this case, or in any other case where the object being printed is not valid according to the network protocol, but doesn't violate any class invariants (if it did, the constructor should have thrown). Instead, I'd expect operator<< to print "invalid signature" and not throw any exceptions.

Actions

Also available in: Atom PDF