ReadConfiguration runtime error if file is unreadable
ameihm0912 opened this issue · comments
In client ReadConfiguration, a runtime error is generated if the configuration file is not readable, this should return a proper error
ReadConfiguration() -> runtime error: index out of range
Hi, I am interested on working on this. What do you mean by a proper error?
It should return the correct error (e.g., file not found / unable to open) ideally (like the actual error from the open operation). I haven't looked into why it's returning a runtime error like this but I'm guessing there is something odd in this function.
The only time a positional argument in the function is used is here (Client.go L183).
// if trailing slash is missing from API url, add it
if conf.API.URL[len(conf.API.URL)-1] != '/' {