Validation And Errors
This page documents the public Go API for validation and errors. Every constructor and method shown here is part of the fluent github.com/nicklambourne/slackblocks/go/v2 package.
ErrorCategory
ErrorCategory identifies a language-neutral conformance error category.
type ErrorCategory string
InvalidUsage
InvalidUsage reports a structurally invalid combination of values.
const InvalidUsage ErrorCategory = "invalid-usage"
Related types: ErrorCategory.
LengthExceeded
LengthExceeded reports a value outside an allowed length bound.
const LengthExceeded ErrorCategory = "length-exceeded"
Related types: ErrorCategory.
MissingRequired
MissingRequired reports an absent value required by Slack's schema.
const MissingRequired ErrorCategory = "missing-required"
Related types: ErrorCategory.
MutuallyExclusive
MutuallyExclusive reports fields that cannot be used together.
const MutuallyExclusive ErrorCategory = "mutually-exclusive"
Related types: ErrorCategory.
OutOfRange
OutOfRange reports a numeric value outside its allowed range.
const OutOfRange ErrorCategory = "out-of-range"
Related types: ErrorCategory.
TypeMismatch
TypeMismatch reports a value with an unexpected wire type.
const TypeMismatch ErrorCategory = "type-mismatch"
Related types: ErrorCategory.
Validate
Validate recursively checks a Slack wire object.
func Validate(object Object) error
Related types: Object.
ValidationError
ValidationError reports why a completed Slack object is invalid.
type ValidationError struct {
Category ErrorCategory
Path string
Detail string
}
Related types: ErrorCategory.
ValidationError.Error
func (e *ValidationError) Error() string
Related types: ValidationError.