Search in sources :

Example 1 with GetChange

use of com.google.gerrit.server.restapi.change.GetChange in project gerrit by GerritCodeReview.

the class ChangeApiImpl method get.

@Override
public ChangeInfo get(EnumSet<ListChangesOption> options, ImmutableListMultimap<String, String> pluginOptions) throws RestApiException {
    try (DynamicOptions dynamicOptions = new DynamicOptions(injector, dynamicBeans)) {
        GetChange getChange = getChangeProvider.get();
        options.forEach(getChange::addOption);
        dynamicOptionParser.parseDynamicOptions(getChange, pluginOptions, dynamicOptions);
        return getChange.apply(change).value();
    } catch (Exception e) {
        throw asRestApiException("Cannot retrieve change", e);
    }
}
Also used : DynamicOptions(com.google.gerrit.server.DynamicOptions) GetChange(com.google.gerrit.server.restapi.change.GetChange) ApiUtil.asRestApiException(com.google.gerrit.server.api.ApiUtil.asRestApiException) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) IllegalLabelException(com.google.gerrit.server.StarredChangesUtil.IllegalLabelException) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) StorageException(com.google.gerrit.exceptions.StorageException) CmdLineException(org.kohsuke.args4j.CmdLineException)

Aggregations

StorageException (com.google.gerrit.exceptions.StorageException)1 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)1 RestApiException (com.google.gerrit.extensions.restapi.RestApiException)1 DynamicOptions (com.google.gerrit.server.DynamicOptions)1 IllegalLabelException (com.google.gerrit.server.StarredChangesUtil.IllegalLabelException)1 ApiUtil.asRestApiException (com.google.gerrit.server.api.ApiUtil.asRestApiException)1 GetChange (com.google.gerrit.server.restapi.change.GetChange)1 CmdLineException (org.kohsuke.args4j.CmdLineException)1