Skip to content

Commit

Permalink
Improve validation error messages, add context
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed Sep 3, 2020
1 parent 7aeee50 commit ce1d4d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/oscal_source/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package oscal_source

import (
"errors"
"fmt"
"github.com/gocomply/oscalkit/pkg/bundled"
"github.com/gocomply/oscalkit/pkg/json_validation"
"github.com/gocomply/oscalkit/pkg/oscal/constants"
Expand All @@ -17,7 +18,7 @@ func (s *OSCALSource) Validate() error {
}
schema, err := s.relevantSchema()
if err != nil {
return err
return fmt.Errorf("Could not find relevant schema: %v", err)
}
defer schema.Cleanup()
return validate(schema.Path, s.UserPath)
Expand Down

0 comments on commit ce1d4d1

Please sign in to comment.