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;

/**
 * @author Administrator
 * @date 2019/9/12  14:02
 */
@JsonSerialize(using = ToflyAuth2ExceptionSerializer.class)
public class MethodNotAllowed extends ToflyAuth2Exception {
    public MethodNotAllowed(String msg, Throwable t) {
        super(msg);
    }

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

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