Questions tagged [boost-exception]

10 questions
12
votes
1 answer

Can I copy-construct a boost::exception with the error info?

Consider the following code employing boost's exception class: class exception : virtual public boost::exception { // ... }; template class exception_impl : virtual public std::exception , public Exc…
sbi
  • 219,715
  • 46
  • 258
  • 445
2
votes
0 answers

Not output throw location (Boost.Exception)

Having trouble throwing an exception using Boost.Exception. 8444950934950830985903859380958309850938905839859080985098940689089689028 class BOOST_SYMBOL_VISIBLE base_exception : virtual public std::exception, virtual public…
0xD
  • 27
  • 2
2
votes
1 answer

How to use BOOST_THROW_EXCEPTION correctly?

I try to use boost exceptions and fall. There are the problem code: struct exception_base : virtual std::exception, virtual boost::exception { exception_base(std::exception&& e) : std::exception(e) {} }; int main() { …
AeroSun
  • 2,401
  • 2
  • 23
  • 46
1
vote
1 answer

boost coroutine server crashes when writting data to client

I made my server based on boost coroutine echo server example, simply receives and writes back some data. It crashes when writing data to client, and more strangely, it only crashes when using mutiple cores. Here's the server, it reads 4 bytes and…
aj3423
  • 2,003
  • 3
  • 32
  • 70
1
vote
1 answer

Why boost::diagnostic_information crashed and how to fix it?

I try to use boost::exception but have the trouble. I write following code: struct BaseExceptionXXX : public virtual std::exception, public virtual boost::exception { public: BaseExceptionXXX() { }; virtual ~BaseExceptionXXX() {}; …
AeroSun
  • 2,401
  • 2
  • 23
  • 46
1
vote
1 answer

How to iterate over all error_info's in boost::exception?

At the catch site of a boost::exception (or std::exception), I want to iterate over all error_info elements of the exception, without knowing the types. I need to extract all the name-value pairs. I guess it should possible since the…
Pat
  • 1,726
  • 11
  • 18
1
vote
1 answer

Boost: API changes between 1.46.1 and 1.58.0?

My application is on Boost version 1.46.1. I want to port my application on Boost version 1.58.0. However I am facing some problems. I have noticed that boost 1.58 has different implementation of boost::exception_ptr from 1.46.1. In 1.46.1,…
0
votes
0 answers

Catch an exception and re-throw as boost exception

I am trying to use Boost exceptions for the additional metadata that I can attach to exceptions as they bubble up the call stack. But one use case I have encountered but do not know how to handle is: how do I catch a std::exception and wrap that…
Phil
  • 5,822
  • 2
  • 31
  • 60
0
votes
0 answers

Is it possible to get boost::exception object from boost::exception_ptr?

Is it possible to get boost::exception object from boost::exception_ptr? If yes How (in boost version 1.5x)?
-1
votes
1 answer

Boost multithreading exception

I have a program like main.cpp #include #include #include class MutexClass { private: /* data */ boost::shared_mutex m_mutex; bool running; //The flag program should…