| 1 | package rundeck |
| 2 | |
| 3 | import "encoding/xml" |
| 4 | |
| 5 | // Error implements the error interface for a Rundeck API error that was |
| 6 | // returned from the server as XML. |
| 7 | type Error struct { |
| 8 | XMLName xml.Name `xml:"result"` |
| 9 | IsError bool `xml:"error,attr"` |
| 10 | Message string `xml:"error>message"` |
| 11 | } |
| 12 | |
| 13 | func (err Error) Error() string { |
| 14 | return err.Message |
| 15 | } |
| 16 | |
| 17 | type NotFoundError struct {} |
| 18 | |
| 19 | func (err NotFoundError) Error() string { |
| 20 | return "not found" |
| 21 | } |