wp-cli/wp-cli — pull request #628 by scribu (2013-08-04 12:58:44+00:00)
Title: WP_CLI::error() - don't call exit(1); directly

This is a problem when calling `WP_CLI::run_command()`. See #627.

One solution would be to throw an exception. This would still abort the existing command, but would allow something like this:

```
try {
WP_CLI::run_command( ... );
} catch ( \WP_CLI\Exceptions\CommandError $e ) {
// pass
}
```

Or we could catch the exception inside `WP_CLI::run_command()` and then just `return 1;`.

If the exception is not caught here, it will get caught by the main runner.