Ask coding questions

← Back to all posts
restart on error
ragnork (2)

My repl is a discord bot the fetches from an api, and i would prefer not to have to restart it every time someone makes a spelling mistake, so is there a way to have my repl restart on an error

Commentshotnewtop
Highwayman (1367)

What exactly do you mean by restart on error? do you mean like if your entire program crashes, you want the repl to automatically restart?

Highwayman (1367)

maybe what you want to do is go into your .replit file and change run="npm start" to
run="while true do npm start done", which will just automatically run your program again every time it shuts down over and over forever...?

IvanChang111 (12)

I have the same problem, except when I restart is still has an error:(