aimeos / ai-client-jsonapi

Aimeos frontend JSON API
GNU Lesser General Public License v3.0
28 stars 6 forks source link

Jsonapi basket response | basket plugin error messages #2

Closed bu-jgerhold closed 5 years ago

bu-jgerhold commented 5 years ago

At the moment (in 2018.10), if you get the basket via the Jsonapi and a basket plugin throws an error the POST is removed from allowed actions for the basket, but the error message is not added to the errors.

I think it would be better if the error messages from basket plugins were added to the Jsonapi response to have a message to show to the user why the basket is not ready to be finished.

aimeos commented 5 years ago

Thank you for your suggestion. We will care about soon

aimeos commented 5 years ago

We've added some code to handle plugin exceptions like in the HTML client and merged it into 2018.10 branch as well. Can you please check if "aimeos/ai-client-jsonapi": "2018.10.x-dev" works now as you expect?

bu-jgerhold commented 5 years ago

Seems like it still only checks the basket in the template.

https://github.com/aimeos/ai-client-jsonapi/blob/2018.10/client/jsonapi/templates/basket/standard.php#L231

aimeos commented 5 years ago

Like discussed: https://github.com/aimeos/ai-client-jsonapi/commit/e8f598bd00378d5c357920e19dd868eee8bc9aa1