Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xray_audit
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
xray_audit
Merge requests
!74
Issue
#3482085
by eduardo morales alberti: List medias that could not be retrieve
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3482085
by eduardo morales alberti: List medias that could not be retrieve
issue/xray_audit-3482085:3482085-list-medias
into
1.x
Overview
9
Commits
10
Pipelines
10
Changes
6
All threads resolved!
Hide all comments
Open
eduardo morales alberti
requested to merge
issue/xray_audit-3482085:3482085-list-medias
into
1.x
1 month ago
Overview
9
Commits
10
Pipelines
10
Changes
6
All threads resolved!
Hide all comments
Expand
Closes
#3482085
0
0
Merge request reports
Compare
1.x
version 9
adef209b
1 month ago
version 8
66a488fc
1 month ago
version 7
983f712a
1 month ago
version 6
967e0aba
1 month ago
version 5
4664b2ed
1 month ago
version 4
9aa25a01
1 month ago
version 3
95aba9cc
1 month ago
version 2
43419df8
1 month ago
version 1
a5a75d82
1 month ago
1.x (HEAD)
and
latest version
latest version
1d1e3d45
10 commits,
1 month ago
version 9
adef209b
9 commits,
1 month ago
version 8
66a488fc
8 commits,
1 month ago
version 7
983f712a
7 commits,
1 month ago
version 6
967e0aba
6 commits,
1 month ago
version 5
4664b2ed
5 commits,
1 month ago
version 4
9aa25a01
4 commits,
1 month ago
version 3
95aba9cc
3 commits,
1 month ago
version 2
43419df8
2 commits,
1 month ago
version 1
a5a75d82
1 commit,
1 month ago
6 files
+
617
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
modules/xray_audit_insight/src/OEmbed/ResourceFetcherDecorator.php
0 → 100644
+
46
−
0
Options
<?php
namespace
Drupal\xray_audit_insight\OEmbed
;
use
Drupal\media\OEmbed\ResourceFetcherInterface
;
use
Drupal\media\OEmbed\ResourceException
;
use
Drupal\xray_audit_insight
\XrayAuditInsightReport
;
/**
* Decorates the original ResourceFetcher service to add logging capabilities.
*/
class
ResourceFetcherDecorator
implements
ResourceFetcherInterface
{
/**
* Constructs a new ResourceFetcherDecorator.
*
* @param \Drupal\media\OEmbed\ResourceFetcherInterface $resourceFetcher
* The original resource fetcher service.
* @param \Drupal\xray_audit_insight\XrayAuditInsightReport $insightReport
* The XrayAuditInsightReport service for logging insights.
*/
public
function
__construct
(
protected
ResourceFetcherInterface
$resourceFetcher
,
protected
XrayAuditInsightReport
$insightReport
,
)
{}
/**
* {@inheritdoc}
*/
public
function
fetchResource
(
$url
)
{
try
{
return
$this
->
resourceFetcher
->
fetchResource
(
$url
);
}
catch
(
ResourceException
$e
)
{
// Log the exception to the xray_audit_insight table.
$this
->
insightReport
->
addInsightData
(
'external_resource'
,
$e
->
getMessage
(),
$url
);
throw
$e
;
}
}
}
Loading