Skip to content

Reduce Storyblok API non-Successful codes to HTTPExceptions#107

Open
llupa wants to merge 2 commits intostoryblok:1.xfrom
llupa:asset-download-failed-exception
Open

Reduce Storyblok API non-Successful codes to HTTPExceptions#107
llupa wants to merge 2 commits intostoryblok:1.xfrom
llupa:asset-download-failed-exception

Conversation

@llupa
Copy link
Copy Markdown
Contributor

@llupa llupa commented Mar 19, 2026

No description provided.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.58%. Comparing base (3eb459e) to head (eaf1c56).
⚠️ Report is 1 commits behind head on 1.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                1.x     #107      +/-   ##
============================================
+ Coverage     94.57%   94.58%   +0.01%     
- Complexity      285      286       +1     
============================================
  Files            43       43              
  Lines          1069     1071       +2     
============================================
+ Hits           1011     1013       +2     
  Misses           58       58              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

$downloaded = $this->downloader->download($metadata->originalUrl);
try {
$downloaded = $this->downloader->download($metadata->originalUrl);
} catch (AssetDownloadFailedException $e) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

couldn't we add an attribute to the AssetDownloadFailedException to map it to the NotFoundHttpException?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can add but just to be sure, the bundle requires symfony/http-kernel: ^6.0. The #[WithHttpStatus] attribute was introduced in Symfony 6.3, so it does not work for people who have 6.0, 6.1, or 6.2.

Shall we bump the requirement or leave as is?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would bump to ease

@llupa llupa force-pushed the asset-download-failed-exception branch from e7f694a to eaf1c56 Compare March 25, 2026 10:11
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.

3 participants