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

Add an understandable description of errors in the Rest API #2605

Closed
NikitaShchienko opened this issue Dec 12, 2023 · 1 comment · Fixed by #2773
Closed

Add an understandable description of errors in the Rest API #2605

NikitaShchienko opened this issue Dec 12, 2023 · 1 comment · Fixed by #2773
Assignees
Labels
in: reports size: S type: bug Something isn't working
Milestone

Comments

@NikitaShchienko
Copy link
Contributor

Environment

Jmix version: 2.1.1

Bug Description

Make an understandable error message and correct the status

Steps To Reproduce

1 - Create a Jmix project with a Reports add-on
2 - Create a report with required parameters
3 - Run the report by Rest API

Current Behavior

Response: Status - 500

{
    "timestamp": "2023-12-12T16:03:08.369+00:00",
    "status": 500,
    "error": "Internal Server Error",
    "path": "/rest/reports/run/a2f873d6-45f0-1c09-73c1-0696c535cc63"
}

Exception:

Request processing failed: java.lang.IllegalArgumentException: Required report parameter "entity" not found
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1019) ~[spring-webmvc-6.0.12.jar:6.0.12]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914) ~[spring-webmvc-6.0.12.jar:6.0.12]

Expected Behavior

Response: Status - 400

{
    "error": "Run report error",
    "details": "Required 'entity' param is missing"
}
@NikitaShchienko NikitaShchienko added type: bug Something isn't working triage Issue is waiting for triage labels Dec 12, 2023
@gorbunkov gorbunkov added in: reports size: S and removed triage Issue is waiting for triage labels Dec 15, 2023
@NikitaShchienko NikitaShchienko self-assigned this Jan 15, 2024
NikitaShchienko added a commit that referenced this issue Jan 19, 2024
@konyashkina
Copy link

Tested on
Jmix version: 2.1.999-SNAPSHOT
Jmix Studio plugin version: 2.1.3-233
IntelliJ version: IntelliJ IDEA 2023.3.3

@gorbunkov gorbunkov added this to the 2.1.3 milestone Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: reports size: S type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants