samedi 19 août 2017

Catchin const char * e but still getting error

I am throwing "Exception: empty queue" and catching const char * e but i still get the error: libc++abi.dylib: terminating with uncaught exception of type char const *

Source File::

  if(isEmpty() == true)
  {
    throw "Exception: empty queue";
  }

Test File::

try
{
    aQueue.dequeue();
}
catch(const char *e)
{
    cout<<e<<endl;
}

Aucun commentaire:

Enregistrer un commentaire