Use BOOST_THROW_EXCEPTION macro to throw

Signed-off-by: Gregor Jasny <gregor.jasny@citrix.com>