Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Gatsby not returning API error #34244

Closed
2 tasks done
MohammedQureshi opened this issue Dec 12, 2021 · 0 comments
Closed
2 tasks done

Gatsby not returning API error #34244

MohammedQureshi opened this issue Dec 12, 2021 · 0 comments

Comments

@MohammedQureshi
Copy link

MohammedQureshi commented Dec 12, 2021

Preliminary Checks

Description

I have got a project set up with Gatsby and Springboot (Java) and I am able to do an API call from Gatsby to Springboot and create a user in my backend but if I get an error some reason Gatsby can't handle it such as I have a validation error that returns "User is not unique" but on Gatsby it just says Internal Server Error but if the API request is successful it works fine it says User Added. Does Gatsby not allow error handling? I am also using a proxy on Gatsby for CORS issues.

Reproduction Link

Non published

Steps to Reproduce

  1. Axios function request
  2. Send Invalid Data
  3. Get response Internal Server Error
    ...

Expected Result

User has to be Unique

Postman response:
"timestamp": 1639313458756,
"status": 400,
"message": "Validation error",
"url": "/api/1.0/users",
"validationErrors": {
"username": "User has to be Unique"
}

Actual Result

Internal Server Error

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 AMD Ryzen 7 5700U with Radeon Graphics
  Binaries:
    Node: 16.13.0 - ~\AppData\Local\Temp\yarn--1639316124987-0.049950630018706255\node.CMD
    Yarn: 1.22.17 - ~\AppData\Local\Temp\yarn--1639316124987-0.049950630018706255\yarn.CMD
    npm: 8.1.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.53)
  npmPackages:
    gatsby: ^3.13.0 => 3.14.6
    gatsby-cli: ^3.13.0 => 3.14.2
    gatsby-image: ^3.11.0 => 3.11.0
    gatsby-plugin-google-analytics: ^3.13.0 => 3.14.0
    gatsby-plugin-image: ^1.13.0 => 1.14.2
    gatsby-plugin-manifest: ^3.13.0 => 3.14.0
    gatsby-plugin-react-helmet: ^4.13.0 => 4.14.0
    gatsby-plugin-react-svg: ^3.0.1 => 3.1.0
    gatsby-plugin-sass: ^4.13.0 => 4.14.0
    gatsby-plugin-sharp: ^3.14.0 => 3.14.3
    gatsby-plugin-sitemap: ^4.9.0 => 4.10.0
    gatsby-source-filesystem: ^3.13.0 => 3.14.0
    gatsby-transformer-sharp: ^3.14.0 => 3.14.0

Config Flags

No response

@MohammedQureshi MohammedQureshi added the type: bug An issue or pull request relating to a bug in Gatsby label Dec 12, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 12, 2021
@LekoArts LekoArts removed type: bug An issue or pull request relating to a bug in Gatsby status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Dec 14, 2021
@gatsbyjs gatsbyjs locked and limited conversation to collaborators Dec 14, 2021
@LekoArts LekoArts converted this issue into discussion #34252 Dec 14, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants