package com.atlassian.bitbucket.mesh.management;

import com.atlassian.bitbucket.mesh.AbstractStatusException;
import com.atlassian.bitbucket.mesh.rpc.v1.RpcError;
import com.atlassian.bitbucket.mesh.rpc.v1.RpcErrorUtils;
import com.atlassian.bitbucket.mesh.rpc.v1.RpcSupportZipFailed;
import io.grpc.Metadata;
import io.grpc.Status;

import javax.annotation.Nullable;

public class SupportZipFailedException extends AbstractStatusException {

    public SupportZipFailedException(@Nullable String message, @Nullable Throwable cause) {
        super(message, cause, Status.INTERNAL);
    }

    @Override
    protected Metadata getTrailers() {
        return RpcErrorUtils.toMetadata(RpcError.newBuilder()
                .setSupportZipFailed(RpcSupportZipFailed.getDefaultInstance())
                .build());
    }
}
