File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
packages/service-library/src/servicelib
services/web/server/src/simcore_service_webserver Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ class InvalidConfig (ValueError ):
2+ # NOTE: If your service can’t load the config on startup for any reason, it should just crash
3+ # SEE https://www.willett.io/posts/precepts/
4+ pass
Original file line number Diff line number Diff line change 55from aiohttp import web
66from aiopg .sa .engine import Engine
77from pydantic import ValidationError
8+ from servicelib .exceptions import InvalidConfig
89
910from ._constants import APP_DB_ENGINE_KEY , APP_PRODUCTS_KEY
1011from .products_db import Product , iter_products
@@ -46,9 +47,9 @@ async def load_products_on_startup(app: web.Application):
4647 log .warning ("There is not front-end registered for this product" )
4748
4849 except ValidationError as err :
49- log . error (
50- "Invalid product in db '%s'. Skipping product info :\n %s" , row , err
51- )
50+ raise InvalidConfig (
51+ f "Invalid product configuration in db '{ row } ' :\n { err } "
52+ ) from err
5253
5354 if FRONTEND_APP_DEFAULT not in app_products .keys ():
5455 log .warning ("Default front-end app is not in the products table" )
You can’t perform that action at this time.
0 commit comments