{"modulePath":"github.com/thecodingmachine/gotenberg","version":"v0.0.0-20210725132755-5a98790dd360","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package xerror\n\nPackage xerror helps standardizing the errors through the application.\n\nCredits: [https://middlemost.com/failure-is-your-domain/](https://middlemost.com/failure-is-your-domain/)\n\n## Functions\n\n```go\nfunc Invalid(op, message string, previous error) error\n```\nInvalid returns a xerror.Error.\n\nShould be used when an input is wrong.\n\n```go\nfunc Message(err error) string\n```\nMessage returns the human-readable message of the error, if available. Otherwise returns a generic error message.\n\n```go\nfunc New(op string, previous error) error\n```\nNew returns a xerror.Error.\n\nShould be used for wrapping an error at the end of a function.\n\n```go\nfunc Op(err error) string\n```\nOp returns the logical operation of the error, if available. Otherwise returns an empty string.\n\n```go\nfunc Timeout(op, message string, previous error) error\n```\nTimeout returns a xerror.Error.\n\nShould be used when a timeout occurs.\n\n## Types\n\n```go\ntype Error struct {\n\t// contains filtered or unexported fields\n}\n```\nError defines our standard application error.\n\n```go\nfunc (e Error) Error() string\n```\nError returns the string representation of the error message.\n\n```go\ntype ErrorCode string\n```\nErrorCode is machine-readable error code.\n\n```go\nconst (\n\t// InternalCode is an internal error.\n\tInternalCode ErrorCode = \"internal\"\n\t// InvalidCode occurs when a validation\n\t// failed.\n\tInvalidCode ErrorCode = \"invalid\"\n\t// TimeoutCode occurs when something\n\t// timed out.\n\tTimeoutCode ErrorCode = \"timeout\"\n)\n```\n\n```go\nfunc Code(err error) ErrorCode\n```\nCode returns the code of the root error, if available. Otherwise returns InternalCode.\n\n","path":"github.com/thecodingmachine/gotenberg/internal/pkg/xerror","name":"xerror","synopsis":"Package xerror helps standardizing the errors through the application.","isRedistributable":true}
