

package com.nantian.sc.cloud.common.security.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.nantian.sc.cloud.common.security.component.ScAuth2ExceptionSerializer;
import org.springframework.http.HttpStatus;

/**
 *
 * @date 2018/7/8
 */
@JsonSerialize(using = ScAuth2ExceptionSerializer.class)
public class UnauthorizedException extends ScAuth2Exception {

	public UnauthorizedException(String msg, Throwable t) {
		super(msg);
	}

	@Override
	public String getOAuth2ErrorCode() {
		return "unauthorized";
	}

	@Override
	public int getHttpErrorCode() {
		return HttpStatus.UNAUTHORIZED.value();
	}

}
