{"modulePath":"github.com/opencloud-eu/opencloud","version":"v1.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Variables\n\n```go\nvar (\n\t// ErrInvalidDepth is an invalid depth header error\n\tErrInvalidDepth = errors.New(\"webdav: invalid depth\")\n\t// ErrInvalidPropfind is an invalid propfind error\n\tErrInvalidPropfind = errors.New(\"webdav: invalid propfind\")\n\t// ErrInvalidProppatch is an invalid proppatch error\n\tErrInvalidProppatch = errors.New(\"webdav: invalid proppatch\")\n\t// ErrInvalidLockInfo is an invalid lock error\n\tErrInvalidLockInfo = errors.New(\"webdav: invalid lock info\")\n\t// ErrUnsupportedLockInfo is an unsupported lock error\n\tErrUnsupportedLockInfo = errors.New(\"webdav: unsupported lock info\")\n\t// ErrInvalidTimeout is an invalid timeout error\n\tErrInvalidTimeout = errors.New(\"webdav: invalid timeout\")\n\t// ErrInvalidIfHeader is an invalid if header error\n\tErrInvalidIfHeader = errors.New(\"webdav: invalid If header\")\n\t// ErrUnsupportedMethod is an unsupported method error\n\tErrUnsupportedMethod = errors.New(\"webdav: unsupported method\")\n\t// ErrInvalidLockToken is an invalid lock token error\n\tErrInvalidLockToken = errors.New(\"webdav: invalid lock token\")\n\t// ErrConfirmationFailed is returned by a LockSystem's Confirm method.\n\tErrConfirmationFailed = errors.New(\"webdav: confirmation failed\")\n\t// ErrForbidden is returned by a LockSystem's Unlock method.\n\tErrForbidden = errors.New(\"webdav: forbidden\")\n\t// ErrLocked is returned by a LockSystem's Create, Refresh and Unlock methods.\n\tErrLocked = errors.New(\"webdav: locked\")\n\t// ErrNoSuchLock is returned by a LockSystem's Refresh and Unlock methods.\n\tErrNoSuchLock = errors.New(\"webdav: no such lock\")\n\t// ErrNotImplemented is returned when hitting not implemented code paths\n\tErrNotImplemented = errors.New(\"webdav: not implemented\")\n)\n```\n\n## Functions\n\n```go\nfunc HandleErrorStatus(log *zerolog.Logger, w http.ResponseWriter, s *rpc.Status)\n```\nHandleErrorStatus checks the status code, logs a Debug or Error level message and writes an appropriate http status\n\n```go\nfunc HandleWebdavError(log *zerolog.Logger, w http.ResponseWriter, b []byte, err error)\n```\nHandleWebdavError checks the status code, logs an error and creates a webdav response body if needed\n\n```go\nfunc Marshal(code int, message string, header string) ([]byte, error)\n```\nMarshal just calls the xml marshaller for a given exception.\n\n```go\nfunc SabreException(code int) string\n```\nSabreException returns a sabre exception text for the HTTP status code. It returns the empty string if the code is unknown.\n\n## Types\n\n```go\ntype ErrorXML struct {\n\tXMLName   xml.Name `xml:\"d:error\"`\n\tXmlnsd    string   `xml:\"xmlns:d,attr\"`\n\tXmlnss    string   `xml:\"xmlns:s,attr\"`\n\tException string   `xml:\"s:exception\"`\n\tMessage   string   `xml:\"s:message\"`\n\tInnerXML  []byte   `xml:\",innerxml\"`\n\t// Header is used to indicate the conflicting request header\n\tHeader string `xml:\"s:header,omitempty\"`\n}\n```\nErrorXML holds the xml representation of an error [http://www.webdav.org/specs/rfc4918.html#ELEMENT\\_error](http://www.webdav.org/specs/rfc4918.html#ELEMENT_error)\n\n```go\ntype Exception struct {\n\tCode    int\n\tMessage string\n\tHeader  string\n}\n```\nException represents a ocdav exception\n\n","path":"github.com/opencloud-eu/opencloud/services/webdav/pkg/errors","name":"errors","synopsis":"","isRedistributable":true}
