Command line client for Write.as https://write.as/apps/cli
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

errors.go 359 B

1234567891011121314151617181920
  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. }