mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-21 19:45:33 +00:00
fix: better error detail for failed sql
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Failing after -35m9s
Build , Vet Test, and Lint / Build (push) Failing after -35m9s
Tests / Unit Tests (push) Failing after -35m10s
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after -35m9s
Build , Vet Test, and Lint / Lint Code (push) Failing after -35m9s
Tests / Integration Tests (push) Failing after -35m10s
Some checks failed
Build , Vet Test, and Lint / Run Vet Tests (1.24.x) (push) Failing after -35m9s
Build , Vet Test, and Lint / Build (push) Failing after -35m9s
Tests / Unit Tests (push) Failing after -35m10s
Build , Vet Test, and Lint / Run Vet Tests (1.23.x) (push) Failing after -35m9s
Build , Vet Test, and Lint / Lint Code (push) Failing after -35m9s
Tests / Integration Tests (push) Failing after -35m10s
This commit is contained in:
@@ -3,6 +3,7 @@ package funcspec
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -1071,6 +1072,10 @@ func sendError(w http.ResponseWriter, status int, code, message string, err erro
|
||||
}
|
||||
if err != nil {
|
||||
errObj.Detail = err.Error()
|
||||
var sqlErr *common.SQLError
|
||||
if errors.As(err, &sqlErr) {
|
||||
errObj.SQL = sqlErr.SQL
|
||||
}
|
||||
}
|
||||
|
||||
data, _ := json.Marshal(map[string]interface{}{
|
||||
|
||||
Reference in New Issue
Block a user