Documentation
¶
Index ¶
- Constants
- Variables
- type DataDumper
- type DefaultStringFormatter
- type DomainError
- type DomainErrorFactory
- func (f *DomainErrorFactory) CleanupFailed(pdfPath string, cause error) error
- func (f *DomainErrorFactory) EngineInvalid(engine string) error
- func (f *DomainErrorFactory) LaTeXCompilationFailed(outputPath string, cause error) error
- func (f *DomainErrorFactory) OutputPathEmpty() error
- func (f *DomainErrorFactory) PDFConversionFailed(pdfPath string, cause error) error
- func (f *DomainErrorFactory) PassesInvalid(passes int) error
- func (f *DomainErrorFactory) TemplatePathEmpty() error
- func (f *DomainErrorFactory) TemplateProcessingFailed(templatePath string, cause error) error
- func (f *DomainErrorFactory) VariableMissing(variable, template string) error
- type ErrorBuilder
- func (b *ErrorBuilder) Build() error
- func (b *ErrorBuilder) WithBlame(blame string) *ErrorBuilder
- func (b *ErrorBuilder) WithCause(cause error) *ErrorBuilder
- func (b *ErrorBuilder) WithDetail(key string, value interface{}) *ErrorBuilder
- func (b *ErrorBuilder) WithDetails(details map[string]interface{}) *ErrorBuilder
- func (b *ErrorBuilder) WithSuggestions(suggestions ...string) *ErrorBuilder
- type JSONDumper
- type PrettyPrinter
- type StringFormatter
Constants ¶
const ( ColorReset = "\033[0m" ColorRed = "\033[31m" ColorYellow = "\033[33m" ColorMagenta = "\033[35m" ColorCyan = "\033[36m" ColorGray = "\033[90m" ColorBold = "\033[1m" )
ANSI color codes (no external deps)
Variables ¶
var ( ErrValidation = errors.New("validation error") ErrNotFound = errors.New("not found") ErrInternal = errors.New("internal error") ErrInvalidInput = errors.New("invalid input") )
Common error categories
Functions ¶
This section is empty.
Types ¶
type DataDumper ¶
type DataDumper interface {
Dump(v interface{}) string
}
DataDumper abstracts pretty-printing of arbitrary Go values
type DefaultStringFormatter ¶
type DefaultStringFormatter struct{}
DefaultStringFormatter uses fmt package (infrastructure adapter)
func (*DefaultStringFormatter) Format ¶
func (f *DefaultStringFormatter) Format(format string, args ...interface{}) string
type DomainError ¶
type DomainError struct {
Category error
Code string
Message string
Blame string
Suggestions []string
Details map[string]interface{}
Cause error
}
DomainError provides structured error information with Elm-style guidance
func (*DomainError) Error ¶
func (e *DomainError) Error() string
func (*DomainError) PrettyError ¶
func (e *DomainError) PrettyError(useColors bool, dumper DataDumper) string
PrettyError renders the error with ANSI colors and readable dumps
func (*DomainError) Unwrap ¶
func (e *DomainError) Unwrap() error
type DomainErrorFactory ¶
type DomainErrorFactory struct {
// contains filtered or unexported fields
}
DomainErrorFactory builds common AutoPDF errors with context
func NewDomainErrorFactory ¶
func NewDomainErrorFactory(formatter StringFormatter) *DomainErrorFactory
func (*DomainErrorFactory) CleanupFailed ¶
func (f *DomainErrorFactory) CleanupFailed(pdfPath string, cause error) error
func (*DomainErrorFactory) EngineInvalid ¶
func (f *DomainErrorFactory) EngineInvalid(engine string) error
func (*DomainErrorFactory) LaTeXCompilationFailed ¶
func (f *DomainErrorFactory) LaTeXCompilationFailed(outputPath string, cause error) error
func (*DomainErrorFactory) OutputPathEmpty ¶
func (f *DomainErrorFactory) OutputPathEmpty() error
func (*DomainErrorFactory) PDFConversionFailed ¶
func (f *DomainErrorFactory) PDFConversionFailed(pdfPath string, cause error) error
func (*DomainErrorFactory) PassesInvalid ¶
func (f *DomainErrorFactory) PassesInvalid(passes int) error
func (*DomainErrorFactory) TemplatePathEmpty ¶
func (f *DomainErrorFactory) TemplatePathEmpty() error
func (*DomainErrorFactory) TemplateProcessingFailed ¶
func (f *DomainErrorFactory) TemplateProcessingFailed(templatePath string, cause error) error
func (*DomainErrorFactory) VariableMissing ¶
func (f *DomainErrorFactory) VariableMissing(variable, template string) error
type ErrorBuilder ¶
type ErrorBuilder struct {
// contains filtered or unexported fields
}
ErrorBuilder builds DomainError instances fluently
func NewInternalError ¶
func NewInternalError(code, message string) *ErrorBuilder
func NewInvalidInputError ¶
func NewInvalidInputError(code, message string) *ErrorBuilder
func NewNotFoundError ¶
func NewNotFoundError(code, message string) *ErrorBuilder
func NewValidationError ¶
func NewValidationError(code, message string) *ErrorBuilder
func (*ErrorBuilder) Build ¶
func (b *ErrorBuilder) Build() error
func (*ErrorBuilder) WithBlame ¶
func (b *ErrorBuilder) WithBlame(blame string) *ErrorBuilder
func (*ErrorBuilder) WithCause ¶
func (b *ErrorBuilder) WithCause(cause error) *ErrorBuilder
func (*ErrorBuilder) WithDetail ¶
func (b *ErrorBuilder) WithDetail(key string, value interface{}) *ErrorBuilder
func (*ErrorBuilder) WithDetails ¶
func (b *ErrorBuilder) WithDetails(details map[string]interface{}) *ErrorBuilder
func (*ErrorBuilder) WithSuggestions ¶
func (b *ErrorBuilder) WithSuggestions(suggestions ...string) *ErrorBuilder
type JSONDumper ¶
type JSONDumper struct{}
JSONDumper is a zero-dependency dumper using json.MarshalIndent
func (JSONDumper) Dump ¶
func (d JSONDumper) Dump(v interface{}) string
type PrettyPrinter ¶
type PrettyPrinter struct {
// contains filtered or unexported fields
}
PrettyPrinter formats errors with ANSI colors and readable dumps
func NewPrettyPrinter ¶
func NewPrettyPrinter(useColors bool, dumper DataDumper) *PrettyPrinter
func (*PrettyPrinter) FormatError ¶
func (pp *PrettyPrinter) FormatError(err *DomainError) string
type StringFormatter ¶
StringFormatter abstracts string formatting operations (DIP compliance)