Skip to content

Pass on faults from methods.#19

Open
jamesfcarter wants to merge 1 commit into
divan:masterfrom
jamesfcarter:master
Open

Pass on faults from methods.#19
jamesfcarter wants to merge 1 commit into
divan:masterfrom
jamesfcarter:master

Conversation

@jamesfcarter
Copy link
Copy Markdown

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
}

edavis added a commit to edavis/gorilla-xmlrpc that referenced this pull request Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant