Classify invalid artifact relations as input errors
This commit is contained in:
@@ -23,12 +23,24 @@ var memberVariableSelectors = map[string]func(PartyCharacter) string{
|
||||
"character.alias_summary": func(character PartyCharacter) string { return character.AliasSummary() },
|
||||
}
|
||||
|
||||
// ArtifactCatalogInputError identifies invalid relations in supplied artifact
|
||||
// configuration. Catalog derivation performs no external I/O.
|
||||
type ArtifactCatalogInputError struct{ cause error }
|
||||
|
||||
func (e *ArtifactCatalogInputError) Error() string { return e.cause.Error() }
|
||||
func (e *ArtifactCatalogInputError) Unwrap() error { return e.cause }
|
||||
|
||||
// DeriveArtifactCatalog interprets the completed pipeline and selected roster
|
||||
// without changing either native configuration result.
|
||||
func DeriveArtifactCatalog(cfg *PipelineConfig, party ResolvedParty) (*ArtifactCatalog, error) {
|
||||
func DeriveArtifactCatalog(cfg *PipelineConfig, party ResolvedParty) (derived *ArtifactCatalog, err error) {
|
||||
if cfg == nil {
|
||||
return nil, fmt.Errorf("pipeline config is required")
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
err = &ArtifactCatalogInputError{cause: err}
|
||||
}
|
||||
}()
|
||||
result := &ArtifactCatalog{Artifacts: map[string]ScriptoriumArtifactConfig{}}
|
||||
definitionSources := declarationSourceLookup(cfg)
|
||||
if cfg.Scriptorium == nil {
|
||||
|
||||
Reference in New Issue
Block a user