From d54999c4d0f0b08b39e31dd35829fb2c0f8521ea Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Wed, 25 Mar 2015 17:03:21 -0700 Subject: [PATCH] Adding iodine to main.go --- main.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 8062883b1..1e533a43f 100644 --- a/main.go +++ b/main.go @@ -73,11 +73,12 @@ func getDriverType(input string) server.DriverType { return server.Memory case input == "donut": return server.Donut + case input == "": + return server.Donut default: { - log.Println("Unknown driver type:", input) - log.Println("Choosing default driver type as 'file'..") - return server.File + log.Fatal("Unknown driver type: '", input, "', Please specify a valid driver.") + return -1 // should never reach here } } } @@ -134,5 +135,11 @@ func main() { app.EnableBashCompletion = true app.Flags = flags app.Action = runCmd - app.Run(os.Args) + err := app.Run(os.Args) + switch typedErr := err.(type) { + case *iodine.Error: + { + log.Errorln(typedErr.EmitHumanReadable()) + } + } }