jdhitsolutions / MySQLite

A small set of PowerShell commands for working with SQLite database files.
MIT License
41 stars 4 forks source link

Graceful SQL exception handling #20

Closed mavaddat closed 10 months ago

mavaddat commented 1 year ago

Invoke-MySQLiteQuery.ps1 does not handle malformed SQL queries gracefully. It currently produces a succession of errors that may be difficult for average users to parse. I have implemented an error delegate script-block to handle exceptions and, if possible, give the user query feedback as provided by the System.Data.SQLite.SQLiteException internals (available through $Error[2].Exception.InnerException.Message -split "`n" when encountering the error).