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

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

import javax.annotation.Nonnull;

public class EditFileException extends AbstractGitException {

    public EditFileException(Exception cause) {
        super("Failed to edit file", cause, Status.INTERNAL);
    }

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