18 lines
497 B
Go
18 lines
497 B
Go
package ambient
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
|
)
|
|
|
|
func (aw *AmbientWeather) GetGatewayOpts() []runtime.ServeMuxOption {
|
|
return []runtime.ServeMuxOption{
|
|
runtime.WithErrorHandler(func(ctx context.Context, sm *runtime.ServeMux, m runtime.Marshaler, w http.ResponseWriter, req *http.Request, err error) {
|
|
aw.GetLogger().Err(err).Msg("error handling gateway request")
|
|
runtime.DefaultHTTPErrorHandler(ctx, sm, m, w, req, err)
|
|
}),
|
|
}
|
|
}
|