error callbacks get a const char *, no longer a std::string

This commit is contained in:
Emiel Bruijntjes 2014-04-15 12:29:22 +02:00
parent 301b8153e3
commit 3b78247363
3 changed files with 4 additions and 21 deletions

View File

@ -485,7 +485,7 @@ public:
* Report an error message on a channel
* @param message
*/
void reportError(const std::string &message)
void reportError(const char *message)
{
// change state
_state = state_closed;
@ -496,7 +496,7 @@ public:
// @todo should this be a std::string parameter?
// inform handler
if (_errorCallback) _errorCallback(message.c_str());
if (_errorCallback) _errorCallback(message);
// leap out if channel is already destructed, or when there are no further callbacks
if (!monitor.valid() || !_oldestCallback) return;

View File

@ -117,28 +117,11 @@ protected:
* @param error Description of the error that occured
* @return Deferred Next deferred result
*/
Deferred *reportError(const std::string& error)
{
// from this moment on the object should be listed as failed
_failed = true;
// execute callbacks if registered
if (_errorCallback) _errorCallback(error.c_str());
if (_finalizeCallback) _finalizeCallback();
// return the next deferred result
return _next;
}
/**
* Indicate failure
* @param error description of the error that occured
*/
Deferred *reportError(const char *error)
{
// from this moment on the object should be listed as failed
_failed = true;
// execute callbacks if registered
if (_errorCallback) _errorCallback(error);
if (_finalizeCallback) _finalizeCallback();

View File

@ -156,7 +156,7 @@ public:
if (!channel) return false;
// report to the handler
channel->reportError(text());
channel->reportError(_text.value().c_str());
// done
return true;