WriteTo xxx
(w http.ResponseWriter)
| 167 | |
| 168 | // WriteTo xxx |
| 169 | func (err FinalError) WriteTo(w http.ResponseWriter) FinalError { |
| 170 | |
| 171 | w.Header().Set("Content-Type", "application/json") |
| 172 | w.Header().Set("X-Amzn-ErrorType", string(err.Code)) |
| 173 | w.Header().Set("X-Bce-ErrorType", string(err.Code)) |
| 174 | |
| 175 | w.WriteHeader(err.Status) |
| 176 | |
| 177 | b, _ := json.Marshal(err) |
| 178 | w.Write(b) |
| 179 | |
| 180 | return err |
| 181 | } |
| 182 | |
| 183 | // NewValidationException xxx |
| 184 | func NewValidationException(cause, message string, lasterr error) FinalError { |
no test coverage detected