package com.tofly.feesapi.security.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.tofly.feesapi.security.compent.ToflyAuth2ExceptionSerializer;
import org.springframework.http.HttpStatus;

@JsonSerialize(using = ToflyAuth2ExceptionSerializer.class)
public class ForbiddenException extends ToflyAuth2Exception {
    public ForbiddenException(String msg, Throwable t) {
        super(msg);
    }

    @Override
    public String getOAuth2ErrorCode() {
        return "无权限访问";
    }

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