Improve command error reporting
state.error is expected to be a String, not an Error.
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
msg = irc.parseMessage(args.join(" "));
|
msg = irc.parseMessage(args.join(" "));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error("failed to parse IRC command: " + err.message);
|
throw new Error("Failed to parse IRC command: " + err.message);
|
||||||
}
|
}
|
||||||
getActiveClient(app).send(msg);
|
getActiveClient(app).send(msg);
|
||||||
},
|
},
|
||||||
|
|||||||
+2
-2
@@ -945,8 +945,8 @@ export default class App extends Component {
|
|||||||
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 });
|
this.setState({ error: error.message });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user