Closed azra1l closed 1 year ago
By the way, the problem also appears on a PC where i have the current version 1.9.0 of simplysql installed.
I stand corrected. For the first time, the error just appeared two times in a row for the same command. Not a third time though. The error was also thrown instantly, it usually takes some time, therefore i linked it to size of the resultset.
@azra1l The error you are receiving is coming from the underlying MySql provider. You will need to investigate what is happening either on the MySQL server or in the MySQL provider that is the problem. Take a look at the entire stacktrack for the error.
@mithrandyr ok, yes, thats the plan :) but why is it that i can't catch the exception thrown? it shouldn't matter where it comes from? when the exception details are shown in console output, it should be possible to catch it in the script i execute...
@azra1l -- I think you need to use the -ErrorAction
parameter and specify "Stop" for the try/catch to work (I believe the module is only throwing non-terminating errors). You may also want to use a more generic catch.
Sometimes, when i query a mariadb database, my powershell script throws this error:
I think it is somehow linked to the size of data returned from the query, but i can't reliably reproduce the error. When i immediatly run the exact same command again, it works without issue, or at least i never had this problem two times in a row. I think it progressively/gradually appears more often.
I tried to build my script around this error with a try/catch block, to just re-run the query if this specific error is thrown, but it somehow doesn't work and my script throws anyways.
Here is my try/catch block:
It doesn't show the warning and will throw right away. Am i using the right error class? Or is it because the module already throws?