0

I know the code below could print the exception, but how do I put the exception message to the std::string?

The code below prints the exception

    proxy.soap_stream_fault(std::cout);
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
Ken Yup
  • 23
  • 7

1 Answers1

2

soap_stream_fault takes any std::ostream&, according to its prototype. Just create a stringstream (or ostringstream). This would probably do it:

std::stringstream strstream;
proxy.soap_stream_fault(strstream);
std::string str{strstream.str()};
demonplus
  • 5,613
  • 12
  • 49
  • 68
J A
  • 335
  • 1
  • 8