Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiP] Handle exception when fetching catalog data #800

Closed
wants to merge 1 commit into from

Conversation

ununhexium
Copy link
Collaborator

#797

Checklist

Edit tasklist title
Beta Give feedback Tasklist Checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. The PR title is short and expressive.
    Options
  2. I have updated the CHANGELOG.md. See changelog_update.md for more information.
    Options
  3. I have updated the Deployment Migration Notes Section in the CHANGELOG.md for any configuration / external API changes.
    Options
  4. I have performed a self-review
    Options

@ununhexium ununhexium linked an issue Feb 14, 2024 that may be closed by this pull request
Copy link
Collaborator

@kulgg kulgg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

val service = new CatalogApiService(mock(AssetMapper.class), mock(PolicyMapper.class), catalogApiService);

// act
val exception = assertThrows(WebApplicationException.class, () -> service.fetchDataOffers("http:example.com"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be minimized to "http://a"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even "" would work, because this is mocked and as long as it gets a string it works.
Does it matter that it be short?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's nit but "http://a" is short and shows the input is a URL
and short is nice

// act
val exception = assertThrows(
DspCatalogServiceException.class,
() -> service.fetchDataOffers("http://example.com"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be minimized to "http://a"

@ununhexium ununhexium changed the title Handle exception when fetching catalog data [WiP] Handle exception when fetching catalog data Feb 20, 2024
return future
.get()
.orElseThrow(DspCatalogServiceException::ofFailure);
} catch (CancellationException | ExecutionException | InterruptedException e) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InterruptedException must always be re-thrown

@tmberthold tmberthold marked this pull request as draft May 23, 2024 08:43
@ununhexium
Copy link
Collaborator Author

Outdated

@ununhexium ununhexium closed this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashing the EDC on catalog request
3 participants