package com.atlassian.bitbucket.rest.repository;

import com.atlassian.bitbucket.repository.DuplicateRefException;
import com.atlassian.bitbucket.rest.annotation.JsonSurrogate;
import com.atlassian.bitbucket.rest.RestErrorMessage;
import org.codehaus.jackson.map.annotate.JsonSerialize;

@JsonSerialize
@JsonSurrogate(DuplicateRefException.class)
public class RestDuplicateRefMessage extends RestErrorMessage {
    public RestDuplicateRefMessage(String context, DuplicateRefException e) {
        super(context, e);
        put("refName", e.getRefName());
    }

    public RestDuplicateRefMessage(DuplicateRefException e) {
        this(null, e);
    }
}
