Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store last error message somewhere #70

Open
novalisek opened this issue Jun 22, 2021 · 0 comments
Open

Store last error message somewhere #70

novalisek opened this issue Jun 22, 2021 · 0 comments

Comments

@novalisek
Copy link

Hi,
would it be possible not just to do

 //part of openFile function

    if (false == CheckFile(filePath, true))
    {
        qDebug() << __FUNCTION__ << "Error - wrong file path:" << filePath;
        return false;
    }

but do something like

    if (false == CheckFile(filePath, true))
    {
        internalError  << __FUNCTION__ << "Error - wrong file path:" << filePath;
        qDebug() <<internalError;
        return false;
    }

 QString xxx::getError()
 {
   return internalError;
  }

everywhere where qDebug() is used, so that I can get latest error message when functions returns false and then report it to user?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant