How to Get error message from DB and display it in QGIS Plugin? - plugins

I am trying to create a Custom QGIS plugin where i connect the Db and execute the queries from a selected file. what I need is to display the usual error message which gets displayed in the DB while any error is raised during the connection and execution.
Please let me know any ways to get the traceback message and display it plugin, I have also referred to the scripts of the DB manager plugin also. but it seems difficult for me to get exactly how they did it.

From this link, try this one:
try:
#your code here
except QgsProviderConnectionException as e:
raise DbError(e)

Related

Error You called write() but provided no data to be written - on shopware plugin activation

i get the error
Error You called write() but provided no data to be written
when i will activate an plugin on shopware, anybody has the same problem and have an tip for me?
This error message is thrown in the snippet manager and means that the plugin, you are trying to install, is trying do load a snippet-file (like main.ini) which has no data in it. You could either remove the file or fill it with snippets.

How to display or customize CRUD error messages in Flask Admin

What is the best way to display when there is error in Listing, Create, Delete or Edit? So far I have created model and custom BaseModelView. Everything seem to work in happy path. I tried throwing exception from the various methods that I had to implement my custom BaseModelView. It result in internal server error. This is probably expected, but how do I show custom error messages for these operation. Is there any provision in Flask Admin for showing custom error messages for the CRUD errors?
I tried Flash message. It worked just fine.

How can i get error report in detailed manner in Locust Load testing tool?

If I am hitting any web page in Locust Load testing tool means ,it throws some error.I want to get the error in detailed summary.
How can I get error report in detailed manner.Is there any function like trace-back in locust it will be used to print the error list in detail.
My coding is like this:
class MyTaskSet(TaskSet):
try:
#task(1)
def index(self):
self.client.get("/")
except Exception as e:
print e.msg
If I test any url like this https://www.python.org/ it will throw error like in below screen shot
Error :ConnectionError(ProtocolError('Connection aborted.', BadStatusLine('''',)),)
I want to get this error in detail.
If I interpret your question correctly, you want to see the traceback for the error that happened in the web app that you are doing HTTP requests against. In that case it's not something you can do in Locust. You need to set up that kind of error reporting / logging within the app that you are load testing.
(please comment and clarify if I've misinterpreted your question, and I'll update the answer).

Using the Plugin Profiler

Hi every one and sorry for my poor English.
Im' trying to use the plugin profiler in Dynamics CRM 2011 but I can't really success to use it.
First, when i try to Profile an asynchronous plugin i'm not able to Download the error Log file (fine with synchronous, th message dialog pop and i can click on the link button to download it)
Is that possible to use Plugin profiler on asynchronous plugin ?? If yes, how i download the error log file ? I know asynchronous plugin are not executed at the same place, that probably why i d'ont have the dialog message but i can see the task have been executed in the "Parameters" "systems task" in the CRM itself. The status of the task is waiting. I can see in the error details something like the error log but i'm not able to download it.
Second, with synchronous plugin it work fine. I'm able to download the error log file and put it in the plugin registration debug tool. But when I attach my process and run the start execution my plugin stop at this line wich work fine when the plugin execute itself normally :
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
//This line i got null references exception
serviceFactory.GetType().GetProperty("ProxyTypesAssembly").SetValue(serviceFactory, typeof(Account).Assembly, null);
I got a null reference exception. This line needed to use early bound in plugin. (If i remove this line i got some error during the plugin execution : "Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type '....'."
After doing some test it's the property he can't get with the Plugin Profiler :
//Null
var myProperty = serviceFactory.GetType().GetProperty("ProxyTypesAssembly");
I got null reference for the property with Plugin Profiler but during a normal execution of the plugin this work fine. Any ideas ??
Thx a lot !
For async plugin you have to select another Profile storage. You need "Persist to Entity" option, not the "Exception". That is step 6 from this link
Hope that helps.

Weird Error from Xcode Debugger

I am using SQL lite database in my iPhone app. I have a refresh button on my Home screen and upon click of then refresh button I parse data from my web service and store the results into a SQL lite database. When I click on refresh button repeatedly I get an error. The error occurs after a variable number of clicks/refreshes each time. The error is:
Failed to load debugging library at:
/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib
Custom data formatters are disabled.
Error message was: 0xe00805 "dlopen(/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib, 10): image not found"`
After this error, my app crashes and when I logged the error it gives me an error "Unable to open database"
Please help me to resolve this error.
Thanks
Sandy
It would appear that the debugger is having a problem loading the data formatters that create the displays for various datatypes in the debugger window's variable display panel. If you've added any customer formatters, you should remove them.
Try running the program without the debugger and see if you get a crash. If so, the problem is in the app. If not, it's most likely in Xcode itself. I would test a dummy project and see if you get the same error.
It's possible there is hellish recursion somewhere in your code. I have seen that bring the debugger down but not with this error message.