fix: add data to 'ErrorUncallableMethod' and 'ErrorUncallableService'

This commit is contained in:
Adrien Marquès 2019-05-01 16:20:32 +02:00
parent 98ae854251
commit 16ea60f2aa
1 changed files with 8 additions and 2 deletions

View File

@ -106,10 +106,16 @@ func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request) {
// fail if found no handler
if serviceHandler == nil {
if serviceFound {
httpError(res, api.ErrorUncallableMethod())
apiError := api.ErrorUncallableMethod()
apiError.Put(servicePath)
apiError.Put(req.Method)
httpError(res, apiError)
return
}
httpError(res, api.ErrorUncallableService())
apiError := api.ErrorUncallableService()
apiError.Put(servicePath)
httpError(res, apiError)
return
}