Closed
Description
New Issue Checklist
- [x ] I am not disclosing a vulnerability.
- [x ] I am not just asking a question.
- [x ] I have searched through existing issues.
- [x ] I can reproduce the issue with the latest version of Parse Server.
Issue Description
I have simple cloudCode function:
Parse.Cloud.define("test", async => {
throw Error("error in function!")
});
What I expect that I get Error (400) response with error JSON. It worked like this before I upgraded from Parse server 4.0.
What I get is Internal server error (500) with HTML output, like:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Error: error in function!<br> at error (/opt/app/node_modules/parse-server/lib/Routers/FunctionsRouter.js:121:16)<br> at processTicksAndRejections (internal/process/task_queues.js:97:5)</pre>
</body>
</html>
Steps to reproduce
Just define cloudCode function and throw Error
Actual Outcome
Internal server error is generated and HTML output is returned
Expected Outcome
JSON response and 400 error is returned
Environment
Server
- Parse Server version: 4.3.0
- Operating system: Ubuntu 18.04 LTS
- Local or remote host: Digital Ocean (but same on local)
Metadata
Metadata
Assignees
Labels
No labels