Skip to content

Instantly share code, notes, and snippets.

@nferch
Created January 13, 2022 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nferch/4cf758659710b1d626c0feb2222eb2bf to your computer and use it in GitHub Desktop.
Save nferch/4cf758659710b1d626c0feb2222eb2bf to your computer and use it in GitHub Desktop.
diff --git a/http/service.go b/http/service.go
index cd7f70d..e7776a1 100644
--- a/http/service.go
+++ b/http/service.go
@@ -876,6 +876,9 @@ func (s *Service) handleExecute(w http.ResponseWriter, r *http.Request) {
if resultsErr != nil {
resp.Error = resultsErr.Error()
+ if results == nil {
+ http.Error(w, resultsErr.Error(), http.StatusInternalServerError)
+ }
} else {
resp.Results.ExecuteResult = results
}
@@ -965,6 +968,9 @@ func (s *Service) handleQuery(w http.ResponseWriter, r *http.Request) {
if resultsErr != nil {
resp.Error = resultsErr.Error()
+ if results == nil {
+ http.Error(w, resultsErr.Error(), http.StatusInternalServerError)
+ }
} else {
resp.Results.QueryRows = results
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment