package com.atlassian.bitbucket.rest;

import com.atlassian.bitbucket.rest.util.RestUtils;

import javax.ws.rs.core.Response;

public abstract class ResourceException extends RuntimeException {

    private static final long serialVersionUID = 8345013342748820431L;

    protected final Response.ResponseBuilder builder;

    protected ResourceException(Response.ResponseBuilder builder) {
        this.builder = builder.type(RestUtils.APPLICATION_JSON_UTF8);
    }

    public Response getResponse() {
        return builder.build();
    }
}
