reworking of log levels for exceptions

Description

When using the c api you need to setup try/catch blocks to print out the error text for the exceptions thrown when there are typos in worker names or properties.

It would be nice if there was a log level to print these out without catching them for debugging purposes. You can see these in log level 8 but there is also much more information then is needed in this log level.

Environment

None

Activity

Show:
James Kulp
March 5, 2015, 8:13 PM

c API or C++ API?
Inside a component or outside a component.
Exceptions are thrown when no continuation is possible.

Would it be helpful to have a more convenient way to catch the exceptions and print errors?
Perhaps a code example would help show what is currently "clumsy".

Chris Hinkey
March 6, 2015, 1:07 PM

try
{
ocpi_app = new OA::Application("my_app.xml" , NULL);
ocpi_app->initialize();

OA::ExternalPort &temp_inPort = ocpi_app->getPort("in");
OA::ExternalPort &temp_outPort = ocpi_app->getPort("out");
ocpi_inPort = &temp_inPort;
ocpi_outPort = &temp_outPort;
ocpi_app->start();
}
catch (std::string &e)
{
printf("OPENCPI Exception thrown: %s\n", e.c_str());
}

specificly if i have a typo in the name of a worker or my OCPI_LIBRARY_PATH is wrong and i don't have this try catch block setup i get no error output.

Just says exception thrown and crashes no feedback of why without adding code.

James Kulp
April 3, 2015, 3:23 PM

Guidance should be put into the app developer guide about proper catching.
Also, more control of logging of exceptions may be useful (i.e. the log level at which
the exception should be logged?)

Assignee

Unassigned

Reporter

Chris Hinkey

Labels

None

Priority

Minor
Configure