This required moving files around in the repository and shifting from a master.adoc structure to _topic_map.yml, etc. README and Makefile modified slightly to reflect new build process
19 lines
345 B
Text
19 lines
345 B
Text
|
|
type Processor interface {
|
|
Process(buf []byte) (message string, err error)
|
|
}
|
|
|
|
type ErrorHandler interface {
|
|
Handle(err error)
|
|
}
|
|
|
|
func RegularError(buf []byte, processor Processor,
|
|
handler ErrorHandler) (message string, err error) {
|
|
message, err = processor.Process(buf)
|
|
if err != nil {
|
|
handler.Handle(err)
|
|
return "", err
|
|
}
|
|
return
|
|
}
|
|
|