Skip to content

Commit

Permalink
Validate processors exist
Browse files Browse the repository at this point in the history
Ensure all processors called exist before starting to process dump.
  • Loading branch information
Emin Tham authored and junkert committed Jul 31, 2020
1 parent c08393d commit 00ac608
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ func (dbMap *DBMapper) Validate() error {
if len(dbMap.DBName) == 0 {
return errors.New("Expected non-empty DBName")
}
// Ensure that each processor is defined
for _, columnMap := range dbMap.ColumnMaps {
for _, processor := range columnMap.Processors {
if _, ok := ProcessorCatalog[processor.Name]; !ok {
return fmt.Errorf("Unrecognized Processor %s", processor.Name)
}
}
}

return nil
}

Expand Down

0 comments on commit 00ac608

Please sign in to comment.