thedatahub / Catmandu-Store-Datahub

Catmandu Store module for the datahub application.
Other
2 stars 2 forks source link

API throws unprocessed Use of uninitialized value $id error #3

Open netsensei opened 7 years ago

netsensei commented 7 years ago

The API.pm module throws up this error. Needs to be fixed / made more human understandable what went wrong.

Use of uninitialized value $id in sprintf at /Users/matthiasvandermaesen/.plenv/versions/5.22.0/lib/perl5/site_perl/5.22.0/Catmandu/Store/Datahub/API.pm line 112.
Odd number of elements in anonymous hash at /Users/matthiasvandermaesen/.plenv/versions/5.22.0/lib/perl5/site_perl/5.22.0/Catmandu/Store/Datahub/API.pm line 128.
Use of uninitialized value in concatenation (.) or string at /Users/matthiasvandermaesen/.plenv/versions/5.22.0/lib/perl5/site_perl/5.22.0/Catmandu/Error.pm line 172.
Use of uninitialized value in concatenation (.) or string at /Users/matthiasvandermaesen/.plenv/versions/5.22.0/lib/perl5/site_perl/5.22.0/Catmandu/Error.pm line 173.
netsensei commented 7 years ago

Apparently this has to do when $id isn't passed to the method calls.

netsensei commented 7 years ago

Commit does not fix issue:

Implementing "update" in the add method was a deliberate design choice.

So, this could should be reverted since it's a major architectural change which really breaks the entire flow.

What we really want is some kind of failure if the $id is present or not in the API update method. Either a Catmandu Exception or False.