Skip to content

Commit c37f15b

Browse files
committed
feat(taxcode): fix error handling
1 parent b27b99b commit c37f15b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

openmeter/taxcode/service/taxcode.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (s *service) UpdateTaxCode(ctx context.Context, input taxcode.UpdateTaxCode
4545
}
4646

4747
if existing.IsManagedBySystem() {
48-
return taxcode.TaxCode{}, taxcode.ErrTaxCodeManagedBySystem
48+
return taxcode.TaxCode{}, models.NewGenericConflictError(taxcode.ErrTaxCodeManagedBySystem)
4949
}
5050

5151
return s.adapter.UpdateTaxCode(ctx, input)
@@ -136,7 +136,7 @@ func (s *service) DeleteTaxCode(ctx context.Context, input taxcode.DeleteTaxCode
136136
}
137137

138138
if existing.IsManagedBySystem() {
139-
return taxcode.ErrTaxCodeManagedBySystem
139+
return models.NewGenericConflictError(taxcode.ErrTaxCodeManagedBySystem)
140140
}
141141

142142
return s.adapter.DeleteTaxCode(ctx, input)

0 commit comments

Comments
 (0)