Skip to content

Commit

Permalink
fix: catch doi errors, cause ckanext-doi is too problematic...
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed May 2, 2024
1 parent a80bdaf commit 1bb30cf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ckanext/ap_doi/plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import logging
from typing import Any
from os import path

Expand All @@ -22,6 +23,8 @@
import ckanext.ap_doi.utils as utils
import ckanext.ap_doi.config as config

log = logging.getLogger(__name__)


@tk.blanket.blueprints
@tk.blanket.actions
Expand Down Expand Up @@ -120,11 +123,17 @@ def after_dataset_create(self, context, pkg_dict):
if config.is_mock_api_calls():
return

super(ApDOIPlugin, self).after_dataset_create(context, pkg_dict)
try:
super(ApDOIPlugin, self).after_dataset_create(context, pkg_dict)
except Exception as e:
log.error(e)

## IPackageController
def after_dataset_update(self, context, pkg_dict):
if config.is_mock_api_calls():
return

super(ApDOIPlugin, self).after_dataset_update(context, pkg_dict)
try:
super(ApDOIPlugin, self).after_dataset_update(context, pkg_dict)
except Exception as e:
log.error(e)

0 comments on commit 1bb30cf

Please sign in to comment.