Command line client for Write.as https://write.as/apps/cli
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
359 B

  1. package impart
  2. import (
  3. "net/http"
  4. )
  5. // HTTPError holds an HTTP status code and an error message.
  6. type HTTPError struct {
  7. Status int
  8. Message string
  9. }
  10. // Error displays the HTTPError's error message and satisfies the error
  11. // interface.
  12. func (h HTTPError) Error() string {
  13. if h.Message == "" {
  14. return http.StatusText(h.Status)
  15. }
  16. return h.Message
  17. }