File: error.go

package info (click to toggle)
golang-github-apparentlymart-go-rundeck-api 0.0.1%2Bgit20170705.2c962ac-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 120 kB
  • sloc: makefile: 2
file content (21 lines) | stat: -rw-r--r-- 427 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package rundeck

import "encoding/xml"

// Error implements the error interface for a Rundeck API error that was
// returned from the server as XML.
type Error struct {
	XMLName xml.Name `xml:"result"`
	IsError bool `xml:"error,attr"`
	Message string `xml:"error>message"`
}

func (err Error) Error() string {
	return err.Message
}

type NotFoundError struct {}

func (err NotFoundError) Error() string {
	return "not found"
}