Resource: load method raises error if resource not found
This commit is contained in:
parent
90cc916461
commit
9dce970909
@ -155,6 +155,11 @@ def wrap_resource(raw_resource):
|
||||
def load(resource_name):
|
||||
raw_resource = db.read(resource_name, collection=db.COLLECTIONS.resource)
|
||||
|
||||
if raw_resource is None:
|
||||
raise NotImplementedError(
|
||||
'Resource {} does not exist'.format(resource_name)
|
||||
)
|
||||
|
||||
return wrap_resource(raw_resource)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user