Skip to content

Server crashed if asynchronous function get error. (uncaughtException) #8193

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

Closed
JeffGuKang opened this issue Sep 24, 2022 · 4 comments
Closed
Labels
type:question Support or code-level question

Comments

@JeffGuKang
Copy link
Contributor

Parse Server crashed when I call some asynchronous function that throws error.
I resolved issue patch the code as below.

uncaughtException

I think process.on('uncaughtException', ...) throw error should be treat in client instead of parse.

How about changing code as below?

if (!process.env.TESTING) {
//This causes tests to spew some useless warnings, so disable in test
/* istanbul ignore next */
process.on('uncaughtException', err => {
if (err.code === 'EADDRINUSE') {
// user-friendly message for this common error
process.stderr.write(`Unable to listen on port ${err.port}. The port is already in use.`);
process.exit(0);
} else {
throw err;
}
});

process.on('uncaughtException', err => {
  if (err.code === 'EADDRINUSE') {
    // user-friendly message for this common error
    process.stderr.write(`Unable to listen on port ${err.port}. The port is already in use.`);
    process.exit(0);
  }
});
@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 24, 2022

Thanks for opening this issue!

  • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.

@JeffGuKang JeffGuKang changed the title Server crashed if asynchronous function get error. Server crashed if asynchronous function get error. (uncaughtException) Sep 24, 2022
@mtrezza
Copy link
Member

mtrezza commented Sep 24, 2022

I'm closing this as it does not use the issue template provided when creating an issue and therefore lacks essential information required to investigate the issue. Please edit your initial post using the issue template and we can re-open this issue.

@mtrezza mtrezza closed this as completed Sep 24, 2022
@mtrezza mtrezza added the type:question Support or code-level question label Sep 24, 2022
@JeffGuKang
Copy link
Contributor Author

Sorry for that. I missed the template cause issue was created from source code. I will recreate with the template.
Thank you.

@mtrezza
Copy link
Member

mtrezza commented Sep 26, 2022

You can just edit your post and we'll reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

2 participants