chore(functions/tips/error): Update http error sample to use declarative signature
@@ -20,8 +20,14 @@ import (
"fmt"
"net/http"
"os"
+
+ "github.com/GoogleCloudPlatform/functions-framework-go/functions"
)
+func init() {
+ functions.HTTP("HTTPError", HTTPError)
+}
+
// HTTPError describes how errors are handled in an HTTP function.
func HTTPError(w http.ResponseWriter, r *http.Request) {
// An error response code is NOT reported to Error Reporting.
