Authentication Error Code Definitions (enums/ErrorCodes.java)

PowerJob · powerjob-common/src/main/java/tech/powerjob/common/enums/ErrorCodes.java · java · Apache-2.0
auth, security, lang:java, tag:error-handling

A centralized enumeration of authentication and authorization error codes. Use this to standardize error handling and messaging across distributed system services.

// Source: https://github.com/PowerJob/PowerJob | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package tech.powerjob.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 鉴权错误信息
 *
 * @author tjq
 * @since 2024/2/11
 */
@Getter
@AllArgsConstructor
public enum ErrorCodes {

    USER_NOT_LOGIN("-100", "UserNotLoggedIn"),
    USER_NOT_EXIST("-101", "UserNotExist"),
    USER_AUTH_FAILED("-102", "UserAuthFailed"),
    /**
     * 账户被停用
     */
    USER_DISABLED("-103", "UserDisabled"),


    NO_PERMISSION("-200", "NoPermission"),

    /**
     * 无效请求,一般是参数问题
     */
    INVALID_REQUEST("-300", "INVALID_REQUEST"),

    INCORRECT_PASSWORD("-400", "INCORRECT_PASSW

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key