Skip to content
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

How to handle global deno error? #16

Open
devalexqt opened this issue May 29, 2020 · 5 comments
Open

How to handle global deno error? #16

devalexqt opened this issue May 29, 2020 · 5 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@devalexqt
Copy link

How to keep app running then connection to db was lost? For now deno process is just die.

//connect ot DB
var db=await connect(...)

const app = new App()
app.use((req,res)=>{...})
@aaronwlee
Copy link
Owner

aaronwlee commented May 29, 2020

try and catch them

try {
  const db = await connect({});
} catch (error) {
  console.log(error, "skip the connection")
}

const app = new App()
....

@aaronwlee aaronwlee self-assigned this May 31, 2020
@aaronwlee
Copy link
Owner

Hi, I've tested the global Deno error issue.
Here is a solution
but this is not a perfect one. it just a temporary solution that automatically restarts the server after an uncaught error. I'll write a comment to the Deno repository about this issue and I hope they could fix it.

@aaronwlee aaronwlee added the wontfix This will not be worked on label May 31, 2020
@itays123
Copy link
Contributor

itays123 commented Aug 7, 2020

I ran into a similar problem when playing around with Deno and MongoDB, and had the same issue.
However working with a PostgreSQL in deno worked just fine.
@devalexqt what database did you use?

@devalexqt
Copy link
Author

I tested with mongodb.

@itays123
Copy link
Contributor

itays123 commented Aug 7, 2020

I guess it's a problem with the Mongo library then, postgres works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants