package com.lutao.cloud.common.security.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lutao.cloud.common.security.component.CloudAuth2ExceptionSerializer;
import org.springframework.http.HttpStatus;

/**

 * @date 2018/7/8
 */
@JsonSerialize(using = CloudAuth2ExceptionSerializer.class)
public class ForbiddenException extends CloudAuth2Exception{

	public ForbiddenException(String msg){
		super(msg);
	}

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

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

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

}
