refine handle_error
Merge branch '3.0' of https://github.com/goagent/goagent into 3.0