parse-community / parse-community/parse-server

Parse Server should return consistent error messages

Open
#7,444 14 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

The Parse Server should return consistent error messages. However, it is returning a message field when an internal error occurs, see:

https://github.com/parse-community/parse-server/blob/d8dc524c08036b2f326730e1ed214ed7a76141cb/src/middlewares.js#L375-L378

However, if you look at the other returns in:

https://github.com/parse-community/parse-server/blob/d8dc524c08036b2f326730e1ed214ed7a76141cb/src/middlewares.js#L364

and

https://github.com/parse-community/parse-server/blob/d8dc524c08036b2f326730e1ed214ed7a76141cb/src/middlewares.js#L368

Steps to reproduce

Sorry, but I don't know how to reproduce it consistently.

Actual Outcome
{ 
   "code": 1, 
   "message": "Internal server error." 
}
Expected Outcome
{ 
   "code": 1, 
   "error": "Internal server error."
}
Failing Test Case / Pull Request
  • 🤩 I submitted a PR with a fix and a test case.
  • 🧐 I submitted a PR with a failing test case.
Environment

Server

  • Parse Server version: 4.5.0
  • Operating system: Linux
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Both

Database

  • System (MongoDB or Postgres): Both
  • Database version: Any
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): Both

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Anyone
  • SDK version: Anyone
Logs

Not applicable

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/middlewares.js at the referenced lines 364, 368, and 375-378, comparing the internal-error response with the other error responses. Confirm that the internal-error response uses the expected error field and verify the resulting JSON response against the issue's expected outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.