Add Go transcript and glossary schemas
This commit is contained in:
23
internal/core/schema/errors.go
Normal file
23
internal/core/schema/errors.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package schema
|
||||
|
||||
import "fmt"
|
||||
|
||||
type ParseError struct {
|
||||
Message string
|
||||
}
|
||||
|
||||
func (e *ParseError) Error() string {
|
||||
return e.Message
|
||||
}
|
||||
|
||||
type ValidationError struct {
|
||||
Field string
|
||||
Message string
|
||||
}
|
||||
|
||||
func (e *ValidationError) Error() string {
|
||||
if e.Field != "" {
|
||||
return fmt.Sprintf("%s: %s", e.Field, e.Message)
|
||||
}
|
||||
return e.Message
|
||||
}
|
||||
Reference in New Issue
Block a user