gorilla-xmlrpc icon indicating copy to clipboard operation
gorilla-xmlrpc copied to clipboard

Pass on faults from methods.

Open jamesfcarter opened this issue 8 years ago • 0 comments

This allows services to generate their own faults. eg

type HelloService struct{}

func (h *HelloService) Say(r *http.Request, args *struct{Who string}, reply *struct{Message string}) error {
    log.Println("Say", args.Who)
    if args.Who == "poop" {
        return xml.Fault{
            Code: 90,
            String: "I refuse to say rude words!",
        }
    }
    reply.Message = "Hello, " + args.Who + "!"
    return nil
}

jamesfcarter avatar Nov 07 '16 17:11 jamesfcarter