Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 29th, 2012  |  syntax: C++  |  size: 0.50 KB  |  views: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <iostream>
  2.  
  3. #include <Poco/Exception.h>
  4.  
  5. int main(int argc, char **argv)
  6. {
  7.     //*
  8.     cout << "Testing throwing/catching Poco Exception" << endl;
  9.     try {
  10.         throw Poco::Exception("test");
  11.     } catch(Poco::Exception &exc) {
  12.         cout << "caught" << endl;
  13.     }
  14.     //*/
  15.  
  16.     cout << "Testing throwing/catching std exception" << endl;
  17.     try {
  18.         throw std::exception();
  19.     } catch(std::exception &exc) {
  20.         cout << "caught" << endl;
  21.     }
  22.  
  23.     return 0;
  24. }
clone this paste RAW Paste Data