Command line client for Write.as https://write.as/apps/cli
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

21 行
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. }