parse-community / parse-community/parse-server
Add ability to customize default Parse Errors
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Feature / Enhancement Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
Current Limitation
Sometimes, it would be good to customize the internal errors caused by Parse Server.
Feature / Enhancement Description
It would be good to have a Cloud Function where we could register Parse.Cloud.onError(className, (error) => {}); where the error can be customized before returning to the client.
Example Use Case
An example of this is if you have mongodb unique schemas set up. Let's say you have the fields "foo" to be unique on the class "Test". If a duplicate "foo" value is presented, the error will be "A duplicate value for a field with unique values was provided" which is often useless to clients. It would be good to be able to do:
Parse.Cloud.onError("Test", (error) => {
if (error.code === Parse.Error.DUPLICATE_VALUE) {
error.message = 'Foo has already been used. Please try a different one';
}
});
Alternatives / Workarounds
Use enableExpressErrorHandler
3rd Party References
https://community.parseplatform.org/t/server-wide-custom-error-messages/255
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed Parse.Cloud.onError entry point and the enableExpressErrorHandler workaround described in the issue. Clarify the callback lifecycle, supported error scope, and response behavior; done should allow internal errors such as duplicate-value errors to be customized before returning to the client.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- express, javascript, node.js
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100