handling exception without stderr printings
- From: Pablo Madoery <madoerypablo gmail com>
- To: libxmlplusplus-list gnome org
- Subject: handling exception without stderr printings
- Date: Tue, 30 Jul 2013 18:00:35 -0300
Hello.
I have the following code:
#include <libxml++/libxml++.h>
#include <iostream>
#include <stdlib.h>
using namespace std;
using namespace xmlpp;
int main()
{
try
{
xmlpp::DomParser parser;
parser.set_throw_messages(true);
parser.parse_file("config.xml");
}
catch (const xmlpp::exception& ex)
{
cout << ex.what() << endl;
}
return 0;
}
The problem i have is the following:
In the case that "config.xml" doesn't exist I want that only exception cout be printed (and not stderr).
But that's not the case. The exception is raised and the stderr is printed too.
How can i make that stderr dont be printed.
Can you help me?.
Thank you very much.
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]