Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show error message from backend (in case of consuming recipe if ingredients with disabled stock fulfillment checking) #866

Open
rugk opened this issue May 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@rugk
Copy link

rugk commented May 4, 2024

STR

See grocy/grocy#2533
TL;DR: Make a recipe with an ingredient with "stock fulfillment checking" disabled. Not have it in stock.

Then try to consume the recipe from the app.

What happens

screen-20240502-225655.mp4

Just shows a very generic error:

Netzwerkfehler

com.android.volley.ClientError
	at com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:257)
	at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:62)
	at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:6)

A server error is shown, but no details. Grocy web, shows this instead:

"{\"error_message\":\"Amount to be consumed cannot be > current stock amount (if supplied, at the desired location)\"}"

What should happen

You may at least pass that error message to the user?

@rugk rugk changed the title Show error message from backend Show error message from backend (in case of consuming recipe if ingredients with disabled stock fulfillment checking) May 4, 2024
@dominiczedler
Copy link
Collaborator

Thanks for the suggestion, I will look whether the API does return the error too.

@rugk
Copy link
Author

rugk commented May 5, 2024

Thanks yeah, maybe you can also show the stock amount even for "stock fulfillment checking"-disabled ingredients to prevent this error from occurring initially. (Especially, as – as indicated upstream – the error message, even if displayed, does not mention the bad ingredient, which can lead to painful debugging of your recipe 😅) Everything else would AFAIK need server support/changes in the general handling, as suggested in grocy/grocy#2533.

@patzly patzly added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants