Commit 6be3cbdc authored by Christophe Benz's avatar Christophe Benz

Don't fail if error loading catalog

parent ee01c9e7
Pipeline #1094 passed with stage
in 4 minutes and 57 seconds
## 0.2.2
Non-breaking changes:
- Don't fail if error loading catalog
## 0.2.1
Non-breaking changes:
......
......@@ -8,11 +8,12 @@ from urllib.parse import quote_plus
import cachecontrol
import flask
import jinja2
import opendataschema
import pkg_resources
import requests
import tableschema
import opendataschema
from . import config
log = logging.getLogger(__name__)
......@@ -51,7 +52,12 @@ class SchemaCatalogRegistry:
def build_schema_catalog(self, name):
if name in self.url_map:
catalog_url = self.url_map[name]
return opendataschema.SchemaCatalog(catalog_url, session=self.session)
try:
catalog = opendataschema.SchemaCatalog(catalog_url, session=self.session)
except requests.exceptions.RequestException as exc:
log.exception(exc)
return None
return catalog
return None
......
......@@ -427,6 +427,7 @@ def homepage_config_with_schema_metadata(ui_config):
section_name = section['name']
schema_catalog = get_schema_catalog(section_name)
if schema_catalog is None:
section['catalog'] = []
continue
schema_list = []
for ref in schema_catalog.references:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment