Skip to content

Commit

Permalink
Merge pull request #70 from cyber-person/superfluous_error_handling
Browse files Browse the repository at this point in the history
superfluous error handling removed
  • Loading branch information
ezavgorodniy authored May 14, 2024
2 parents 63f6f3b + ef2b645 commit f138f47
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions pkg/model/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ func ParseModel(config *common.Config, modelInput *input.Model, builtinRiskRules
technicalAssetTechnologies = append(technicalAssetTechnologies, technicalAssetTechnology)
}

if err != nil {
return nil, fmt.Errorf("unknown 'technology' value of technical asset %q: %v", title, asset.Technology)
}
encryption, err := types.ParseEncryptionStyle(asset.Encryption)
if err != nil {
return nil, fmt.Errorf("unknown 'encryption' value of technical asset %q: %v", title, asset.Encryption)
Expand Down Expand Up @@ -286,9 +283,6 @@ func ParseModel(config *common.Config, modelInput *input.Model, builtinRiskRules
}

dataFlowTitle := fmt.Sprintf("%v", commLinkTitle)
if err != nil {
return nil, err
}
commLinkId, err := createDataFlowId(id, dataFlowTitle)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/script/script.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (what *Script) generateRisk(outerScope *common.Scope, techAsset any) (*type
}

newValue, errorEvalLiteral, evalError := expression.EvalAny(scope)
if parseError != nil {
if evalError != nil {
return nil, errorEvalLiteral, fmt.Errorf("failed to eval field value: %v", evalError)
}

Expand Down

0 comments on commit f138f47

Please sign in to comment.