Add exports to make router usable as a library

This commit is contained in:
Soam Vasani
2016-10-29 20:40:41 -07:00
parent 83c995e019
commit fbd76149f5
3 changed files with 8 additions and 30 deletions
+3 -2
View File
@@ -42,10 +42,11 @@ func (fh *functionHandler) handler(responseWriter http.ResponseWriter, request *
// Cache miss: request the Pool Manager to make a new service.
serviceUrl, poolErr := fh.getServiceForFunction()
if poolErr != nil {
// now we're really screwed
log.Printf("Failed to get service for function (%v,%v): %v",
fh.Function.Name, fh.Function.Uid, poolErr)
responseWriter.WriteHeader(500) // TODO: make this smarter based on the actual error
// We might want a specific error code or header for fission
// failures as opposed to user function bugs.
http.Error(responseWriter, poolErr.Error(), 500)
return
}