> For the complete documentation index, see [llms.txt](https://ephf.gitbook.io/discord-short/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ephf.gitbook.io/discord-short/creating-bot-commands/code-errors.md).

# Code Errors

If your code runs into an error, don't worry!

Using Discord.Short, your program will not shut down. You can also add an error message if something goes wrong, you can do it by running this:

```javascript
ds.setCodeErrorReply('Sorry, Something Went Wrong 😨');
```

Then, we can write an error in our command:

```javascript
new ds.Command({
    name: 'ping',
    async execute({send}) {
        lol; // <-- undefined
    }
});
```

Then when we run the command in discord, it will show the error message:

![in discord](https://1070540812-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M_6wR-SQ66c91BUYwWE%2F-M_rnEddf-EgDbFTTzZ8%2F-M_roM8ftvyFGXB1vlff%2Fcommanderror.png?alt=media\&token=12e2827d-e4a2-4da4-b7c1-f78930008db3)
