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

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lutao.cloud.common.security.component.CloudAuth2ExceptionSerializer;
import lombok.Getter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**

 * @date 2018/7/8 自定义OAuth2Exception
 */
@JsonSerialize(using = CloudAuth2ExceptionSerializer.class)
public class CloudAuth2Exception extends OAuth2Exception{

	@Getter
	private String errorCode;

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

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

	public CloudAuth2Exception(String msg, String errorCode){
		super(msg);
		this.errorCode = errorCode;
	}

}
