Documentation ¶
Index ¶
- Variables
- func HandleErrorStatus(log *zerolog.Logger, w http.ResponseWriter, s *rpc.Status)
- func HandleWebdavError(log *zerolog.Logger, w http.ResponseWriter, b []byte, err error)
- func Marshal(code int, message string, header string) ([]byte, error)
- func SabreException(code int) string
- type ErrorXML
- type Exception
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidDepth is an invalid depth header error ErrInvalidDepth = errors.New("webdav: invalid depth") // ErrInvalidPropfind is an invalid propfind error ErrInvalidPropfind = errors.New("webdav: invalid propfind") // ErrInvalidProppatch is an invalid proppatch error ErrInvalidProppatch = errors.New("webdav: invalid proppatch") // ErrInvalidLockInfo is an invalid lock error ErrInvalidLockInfo = errors.New("webdav: invalid lock info") // ErrUnsupportedLockInfo is an unsupported lock error ErrUnsupportedLockInfo = errors.New("webdav: unsupported lock info") // ErrInvalidTimeout is an invalid timeout error ErrInvalidTimeout = errors.New("webdav: invalid timeout") // ErrInvalidIfHeader is an invalid if header error ErrInvalidIfHeader = errors.New("webdav: invalid If header") // ErrUnsupportedMethod is an unsupported method error ErrUnsupportedMethod = errors.New("webdav: unsupported method") // ErrInvalidLockToken is an invalid lock token error ErrInvalidLockToken = errors.New("webdav: invalid lock token") // ErrConfirmationFailed is returned by a LockSystem's Confirm method. ErrConfirmationFailed = errors.New("webdav: confirmation failed") // ErrForbidden is returned by a LockSystem's Unlock method. ErrForbidden = errors.New("webdav: forbidden") // ErrLocked is returned by a LockSystem's Create, Refresh and Unlock methods. ErrLocked = errors.New("webdav: locked") // ErrNoSuchLock is returned by a LockSystem's Refresh and Unlock methods. ErrNoSuchLock = errors.New("webdav: no such lock") // ErrNotImplemented is returned when hitting not implemented code paths ErrNotImplemented = errors.New("webdav: not implemented") )
Functions ¶
func HandleErrorStatus ¶
HandleErrorStatus checks the status code, logs a Debug or Error level message and writes an appropriate http status
func HandleWebdavError ¶
HandleWebdavError checks the status code, logs an error and creates a webdav response body if needed
func SabreException ¶
SabreException returns a sabre exception text for the HTTP status code. It returns the empty string if the code is unknown.
Types ¶
type ErrorXML ¶
type ErrorXML struct { XMLName xml.Name `xml:"d:error"` Xmlnsd string `xml:"xmlns:d,attr"` Xmlnss string `xml:"xmlns:s,attr"` Exception string `xml:"s:exception"` Message string `xml:"s:message"` InnerXML []byte `xml:",innerxml"` // Header is used to indicate the conflicting request header Header string `xml:"s:header,omitempty"` }
ErrorXML holds the xml representation of an error http://www.webdav.org/specs/rfc4918.html#ELEMENT_error
Click to show internal directories.
Click to hide internal directories.