Adding iodine to pkg/server/server.go

master
Frederick F. Kautz IV 10 years ago
parent 673072579d
commit d52dd5ed5b
  1. 16
      pkg/server/server.go

@ -17,11 +17,12 @@
package server package server
import ( import (
"log"
"os/user" "os/user"
"path" "path"
"reflect" "reflect"
"errors"
"github.com/minio-io/iodine"
"github.com/minio-io/minio/pkg/api" "github.com/minio-io/minio/pkg/api"
"github.com/minio-io/minio/pkg/api/web" "github.com/minio-io/minio/pkg/api/web"
"github.com/minio-io/minio/pkg/drivers" "github.com/minio-io/minio/pkg/drivers"
@ -29,6 +30,7 @@ import (
"github.com/minio-io/minio/pkg/drivers/file" "github.com/minio-io/minio/pkg/drivers/file"
"github.com/minio-io/minio/pkg/drivers/memory" "github.com/minio-io/minio/pkg/drivers/memory"
"github.com/minio-io/minio/pkg/server/httpserver" "github.com/minio-io/minio/pkg/server/httpserver"
"github.com/minio-io/minio/pkg/utils/log"
) )
// Config - http server parameters // Config - http server parameters
@ -107,7 +109,10 @@ func getHTTPChannels(configs []Config) (ctrlChans []chan<- string, statusChans [
statusChans = append(statusChans, statusChan) statusChans = append(statusChans, statusChan)
} }
default: default:
log.Fatal("Invalid api type") {
err := iodine.New(errors.New("Invalid API type"), nil)
log.Fatal(err.EmitHumanReadable())
}
} }
} }
return return
@ -137,6 +142,7 @@ func getDriverChannels(driverType DriverType) (ctrlChans []chan<- string, status
{ {
u, err := user.Current() u, err := user.Current()
if err != nil { if err != nil {
log.Errorln(iodine.New(err, nil).EmitHumanReadable())
return nil, nil, nil return nil, nil, nil
} }
root := path.Join(u.HomeDir, "minio-storage", "file") root := path.Join(u.HomeDir, "minio-storage", "file")
@ -148,6 +154,7 @@ func getDriverChannels(driverType DriverType) (ctrlChans []chan<- string, status
{ {
u, err := user.Current() u, err := user.Current()
if err != nil { if err != nil {
log.Errorln(iodine.New(err, nil).EmitHumanReadable())
return nil, nil, nil return nil, nil, nil
} }
root := path.Join(u.HomeDir, "minio-driver", "donut") root := path.Join(u.HomeDir, "minio-driver", "donut")
@ -156,7 +163,10 @@ func getDriverChannels(driverType DriverType) (ctrlChans []chan<- string, status
statusChans = append(statusChans, statusChan) statusChans = append(statusChans, statusChan)
} }
default: // should never happen default: // should never happen
log.Fatal("No driver found") {
err := iodine.New(errors.New("No driver found"), nil)
log.Fatal(err.EmitHumanReadable())
}
} }
return return
} }

Loading…
Cancel
Save