package com.atlassian.bitbucket.mesh.git.exception;

import com.atlassian.bitbucket.mesh.rpc.v1.RpcGitError;
import com.atlassian.bitbucket.mesh.rpc.v1.RpcNoMergeBase;
import io.grpc.Status;

import javax.annotation.Nonnull;

public class NoMergeBaseException extends AbstractGitException {

    public NoMergeBaseException() {
        super("No merge base", Status.NOT_FOUND);
    }

    @Nonnull
    @Override
    public RpcGitError toError() {
        return RpcGitError.newBuilder()
                .setNoMergeBase(RpcNoMergeBase.getDefaultInstance())
                .build();
    }
}
