diff -r 807ec6498502 -r a0982873d655 tool/cmd_states.cpp --- a/tool/cmd_states.cpp Wed Jul 23 07:29:00 2008 +0000 +++ b/tool/cmd_states.cpp Wed Jul 23 08:06:10 2008 +0000 @@ -22,13 +22,13 @@ void command_states(void) { + stringstream err; string stateStr; uint8_t state; if (commandArgs.size() != 1) { - stringstream err; - err << "'state' takes exactly one argument!"; - throw MasterDeviceException(err.str()); + err << "'" << commandName << "' takes exactly one argument!"; + throw InvalidUsageException(err); } stateStr = commandArgs[0]; @@ -44,9 +44,8 @@ } else if (stateStr == "OP") { state = 0x08; } else { - stringstream err; err << "Invalid state '" << commandArgs[0] << "'!"; - throw MasterDeviceException(err.str()); + throw InvalidUsageException(err); } masterDev.open(MasterDevice::ReadWrite);