handling exception without stderr printings



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]