mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Merge pull request #3095 from aaa2000/api-error-on-fail-fetch-content
Create a new entry via API even when its content can't be retrieved
This commit is contained in:
commit
91ba9a5975
2 changed files with 47 additions and 4 deletions
|
@ -200,10 +200,19 @@ class EntryRestController extends WallabagRestController
|
|||
$entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
|
||||
|
||||
if (false === $entry) {
|
||||
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
|
||||
new Entry($this->getUser()),
|
||||
$url
|
||||
);
|
||||
$entry = new Entry($this->getUser());
|
||||
try {
|
||||
$entry = $this->get('wallabag_core.content_proxy')->updateEntry(
|
||||
$entry,
|
||||
$url
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
$this->get('logger')->error('Error while saving an entry', [
|
||||
'exception' => $e,
|
||||
'entry' => $entry,
|
||||
]);
|
||||
$entry->setUrl($url);
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_null($title)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue