Add hint to run /help in unknown command error message

This commit is contained in:
Simon Ser 2021-05-27 12:54:30 +02:00
parent 45c12fb684
commit d880b23d32

View File

@ -940,14 +940,14 @@ export default class App extends Component {
var cmd = commands[name]; var cmd = commands[name];
if (!cmd) { if (!cmd) {
this.setState({ error: "Unknown command '" + name + "'" }); this.setState({ error: `Unknown command "${name}" (run "/help" to get a command list)` });
return; return;
} }
try { try {
cmd.execute(this, args); cmd.execute(this, args);
} catch (error) { } catch (error) {
console.error("Failed to execute command '" + name + "':", error); console.error(`Failed to execute command "${name}":`, error);
this.setState({ error: error.message }); this.setState({ error: error.message });
} }
} }