Skip to content

Commit

Permalink
Return unimplemented error if Open Sanctions is not reachable on data…
Browse files Browse the repository at this point in the history
…set retrieval.
  • Loading branch information
apognu committed Feb 27, 2025
1 parent 2f8e083 commit 4969cd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions repositories/opensanctions_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func (repo OpenSanctionsRepository) GetCatalog(ctx context.Context) (models.Open
return cached, nil
}

if ok, err := repo.IsConfigured(ctx); !ok {
return models.OpenSanctionsCatalog{}, err
}

catalogUrl := fmt.Sprintf("%s/catalog", repo.opensanctions.Host())

req, err := http.NewRequestWithContext(ctx, http.MethodGet, catalogUrl, nil)
Expand Down

0 comments on commit 4969cd7

Please sign in to comment.