Open bzar opened 2 years ago
Hey, @bzar, I just tested this via curl, I sent an id that doesn't exist, and it gives me the proper error message: 404 not found. https://github.com/ckan/ckan/blob/7586d78682c30f205027522214f33ee2bf413055/ckan/logic/action/update.py#L73-L76 if you look at the code you can see in line 73 we have another check
if resource is None
and here are my logs:
It's actually 2.9 and earlier issue, master has a check for it. 2.9 does not https://github.com/ckan/ckan/blob/ca537ad25e13320b6fbf91f41031eadc30500f12/ckan/logic/action/update.py#L73-L79
Yeah, my bad. I tested this on our 2.9.5 instance and demo.ckan.org, saw the same order for those lines in master and assumed it was still an issue.
CKAN version master
Describe the bug Trying to update a resource that does not exist causes an internal server error instead of a not found error
Steps to reproduce
httpie
:http POST https://demo.ckan.org/api/action/resource_update id=doesnotexist
Expected behavior
Additional details Caused by this line being placed before these lines.