fix error handler
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
6
http.go
6
http.go
@@ -602,11 +602,15 @@ func (h *httpServer) Name() string {
|
||||
|
||||
func NewServer(opts ...server.Option) *httpServer {
|
||||
options := server.NewOptions(opts...)
|
||||
eh := DefaultErrorHandler
|
||||
if v, ok := options.Context.Value(errorHandlerKey{}).(errorHandler); ok && v != nil {
|
||||
eh = v
|
||||
}
|
||||
return &httpServer{
|
||||
opts: options,
|
||||
exit: make(chan chan error),
|
||||
subscribers: make(map[*httpSubscriber][]broker.Subscriber),
|
||||
errorHandler: DefaultErrorHandler,
|
||||
errorHandler: eh,
|
||||
pathHandlers: rhttp.NewTrie(),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user