Skip to content

Commit

Permalink
fix: propagate meaningful errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pallabpain committed Jul 12, 2024
1 parent 3cb05c5 commit c2c08d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hscontrol/policy/acls.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ func LoadACLPolicyFromBytes(acl []byte) (*ACLPolicy, error) {

ast, err := hujson.Parse(acl)
if err != nil {
return nil, err
return nil, fmt.Errorf("parsing hujson, err: %w", err)
}

ast.Standardize()
acl = ast.Pack()

if err := json.Unmarshal(acl, &policy); err != nil {
return nil, err
return nil, fmt.Errorf("unmarshalling policy, err: %w", err)
}

if policy.IsZero() {
Expand Down

0 comments on commit c2c08d9

Please sign in to comment.