How to read error messages?

Here is an example of an error I’m getting when I try to run a go service I’m writing.

…/…/signals/signals.go:48:20: not enough arguments in call to logging.LogError
have (string, string)
want (int, int, string, http.ResponseWriter)

The problem is, instead of telling me the file and line number where the function is being called without enough parameters, it is showing me the function itself and the file it is located in. I’ve reviewed all of the code in my program and there is NO place where it is missing parameters. So I’m stuck and have no idea what my problem is.

Any ideas?

I did a grep to get a list of places where I’m calling LogError

goservertemplate.go: logging.LogError(0,0,msg, nil)
goservertemplate.go: logging.LogError( 0, 500, “No Database Connection Exists”, w )
goservertemplate.go: logging.LogError( 0, 500, “Problem running query.”, w )
goservertemplate.go: logging.LogError( 0, 500, “There was a problem retrieving data.”, w )

Here is the function itself:

func (lf *LogFile) LogError(  errcode int,
                              httpcode int,
                              errtext string,
                              w http.ResponseWriter ) {

Sorry, being blind atm. I was thinking I was in the signals.go file with my function but wasn’t. It was another file in the same directory and it was in fact telling me where the problem was if I listened.

All good.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.