SQL Expressions: Include SQL Parser/Syntax error in the public message (#100725)

fixes #100721
This commit is contained in:
Kyle Brandt
2025-02-14 09:09:21 -05:00
committed by GitHub
parent 196a73ec72
commit c291ec7ba9
2 changed files with 18 additions and 1 deletions

View File

@ -31,7 +31,7 @@ func NewSQLCommand(refID, rawSQL string) (*SQLCommand, error) {
if err != nil {
logger.Warn("invalid sql query", "sql", rawSQL, "error", err)
return nil, errutil.BadRequest("sql-invalid-sql",
errutil.WithPublicMessage("error reading SQL command"),
errutil.WithPublicMessage(fmt.Sprintf("invalid SQL query: %s", err)),
)
}
if len(tables) == 0 {