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

DBManager fails to display error messages with virtual layers #28014

Closed
qgib opened this issue Oct 23, 2018 · 8 comments
Closed

DBManager fails to display error messages with virtual layers #28014

qgib opened this issue Oct 23, 2018 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin High Priority Regression Something which used to work, but doesn't anymore

Comments

@qgib
Copy link
Contributor

qgib commented Oct 23, 2018

Author Name: Regis Haubourg (@haubourg)
Original Redmine Issue: 20193
Affected QGIS version: 3.3(master)
Redmine category:db_manager
Assignee: Alessandro Pasotti


In QGIS master, error messages when trying to work with virtual layers are no more catched.

IN QGIS 2.1, just issuing a wrong query like

SELECT *

returned a window with

Query preparation error on PRAGMA table_info(_tview): no tables specified

In QGIS master, this error window is empty.

@qgib
Copy link
Contributor Author

qgib commented Oct 23, 2018

Author Name: Regis Haubourg (@haubourg)


Also occurs in QGIS 3.2.2

@qgib
Copy link
Contributor Author

qgib commented Oct 23, 2018

Author Name: Alessandro Pasotti (@elpaso)


  • assigned_to_id was configured as Alessandro Pasotti

@qgib
Copy link
Contributor Author

qgib commented Oct 23, 2018

Author Name: Giovanni Manghi (@gioman)


as far as I remember it does not affect only virtual layers-

@qgib
Copy link
Contributor Author

qgib commented Oct 23, 2018

Author Name: Hugo Mercier (@mhugo)


From what I can see, there is at least the following problem:

bool QgsVirtualLayerTask::run()
{
  bool rc = false;
  try
  {
    mLayer->reload(); // blocking call because the loading is postponed
    rc = mLayer->isValid();
  }
  catch ( std::exception &e )
  {
    QgsDebugMsg( QStringLiteral( "Reload error: %1" ).arg( e.what() ) );
    rc = false;
  }
  return rc;
}

The error is catched and displayed in a QgsDebugMsg. It seems there is no way to set an error status on a qgstask ?

@qgib
Copy link
Contributor Author

qgib commented Oct 23, 2018

Author Name: Alessandro Pasotti (@elpaso)


PR #8283


  • status_id was changed from Open to In Progress
  • pull_request_patch_supplied was changed from 0 to 1

@qgib
Copy link
Contributor Author

qgib commented Oct 23, 2018

Author Name: Alessandro Pasotti (@elpaso)


Sorry Hugo, I didn't see your comment before I made the PR.

Yes: there is no way to store an error message, that's why there is a wrapper for that in code: https://github.com/qgis/QGIS/blob/master/python/core/additions/qgstaskwrapper.py

I'm not sure what would be the best re-usable approach here but the bugfix I've implemented was exactly to add exceptionText to the task in order to store the error message.

@qgib
Copy link
Contributor Author

qgib commented Oct 23, 2018

Author Name: Hugo Mercier (@mhugo)


No problem :)

@qgib
Copy link
Contributor Author

qgib commented Oct 24, 2018

Author Name: Alessandro Pasotti (@elpaso)


Implemented with #8283


  • resolution was changed from to fixed/implemented
  • status_id was changed from In Progress to Closed

@qgib qgib closed this as completed Oct 24, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority DB Manager Relating to the DB Manager core plugin Regression Something which used to work, but doesn't anymore labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! DB Manager Relating to the DB Manager core plugin High Priority Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

1 participant