carddav: populate AddressBook.{Name,MaxResourceSize} in client
This commit is contained in:
@@ -50,7 +50,7 @@ func (s *Status) Err() error {
|
||||
|
||||
// TODO: handle 2xx, 3xx
|
||||
if s.Code != http.StatusOK {
|
||||
return fmt.Errorf("webdav: HTTP error: %v %v", s.Code, s.Text)
|
||||
return &HTTPError{Code: s.Code}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@@ -24,6 +24,10 @@ func HTTPErrorFromError(err error) *HTTPError {
|
||||
}
|
||||
}
|
||||
|
||||
func IsNotFound(err error) bool {
|
||||
return HTTPErrorFromError(err).Code == http.StatusNotFound
|
||||
}
|
||||
|
||||
func HTTPErrorf(code int, format string, a ...interface{}) *HTTPError {
|
||||
return &HTTPError{code, fmt.Errorf(format, a...)}
|
||||
}
|
||||
|
Reference in New Issue
Block a user