| 59 | } |
| 60 | |
| 61 | func (resp *ErrorResponse) MarshalXML(e *xml.Encoder, _ xml.StartElement) error { |
| 62 | return e.Encode(struct { |
| 63 | XMLName xml.Name |
| 64 | Name string `xml:"name"` |
| 65 | ID string `xml:"id"` |
| 66 | Message string `xml:"message"` |
| 67 | Temporary bool `xml:"temporary"` |
| 68 | Timeout bool `xml:"timeout"` |
| 69 | Fault bool `xml:"fault"` |
| 70 | }{ |
| 71 | XMLName: ErrorResponseXMLName, |
| 72 | Name: resp.Name, |
| 73 | ID: resp.ID, |
| 74 | Message: resp.Message, |
| 75 | Temporary: resp.Temporary, |
| 76 | Timeout: resp.Timeout, |
| 77 | Fault: resp.Fault, |
| 78 | }) |
| 79 | } |
| 80 | |
| 81 | // StatusCode implements a heuristic that computes a HTTP response status code |
| 82 | // appropriate for the timeout, temporary and fault characteristics of the |