package com.atlassian.bitbucket.rest.auth;

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

@JsonSerialize
@JsonSurrogate(AuthenticationRequiredException.class)
public class RestAuthenticationRequiredErrorMessage extends RestErrorMessage {
    public RestAuthenticationRequiredErrorMessage(AuthenticationRequiredException e) {
        super(e);
        put("authenticationUri", e.getAuthenticationUri().toString());
        put("applicationName", e.getApplicationName());
    }
}
