justauth/JustAuth · error · AuthException

object.getString("erroe_msg")

Error message

object.getString("erroe_msg")

What it means

AuthMeituanRequest.checkResponse throws when the Meituan response contains 'error_code'. Note the code reads the misspelled key 'erroe_msg' to build the message, so depending on Meituan's actual payload the message may be null even though an error was detected.

Source

Thrown at src/main/java/me/zhyd/oauth/request/AuthMeituanRequest.java:105

        String response = new HttpUtils(config.getHttpConfig()).post(source.refresh(), form, false).getBody();
        JSONObject object = JSONObject.parseObject(response);

        this.checkResponse(object);

        return AuthResponse.<AuthToken>builder()
            .code(AuthResponseStatus.SUCCESS.getCode())
            .data(AuthToken.builder()
                .accessToken(object.getString("access_token"))
                .refreshToken(object.getString("refresh_token"))
                .expireIn(object.getIntValue("expires_in"))
                .build())
            .build();
    }

    private void checkResponse(JSONObject object) {
        if (object.containsKey("error_code")) {
            throw new AuthException(object.getString("erroe_msg"));
        }
    }

    @Override
    public String authorize(String state) {
        return UrlBuilder.fromBaseUrl(super.authorize(state))
            .queryParam("scope", "")
            .build();
    }

}

View on GitHub (pinned to 694bbf1b01)

Solutions

  1. Log the whole AuthException including cause; if message is null, capture the raw HTTP response to see Meituan's real error fields
  2. Verify AuthConfig clientId/clientSecret for the Meituan open platform
  3. If you control the dependency, patch/upgrade JustAuth so the key is spelled 'error_msg'
  4. Check Meituan's error_code value against their open-platform docs

Example fix

// before (JustAuth internal, message may be null)
throw new AuthException(object.getString("erroe_msg"));

// after (fixed key)
throw new AuthException(object.getString("error_msg"));
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try {
    meituanRequest.getAuthResponse(callback);
} catch (AuthException e) {
    log.warn("Meituan error_code present, message (may be null due to key typo): {}", e.getMessage());
    // capture raw response via your own HttpConfig interceptor for real diagnostics
}

Prevention

When it happens

Trigger: Token or user-info calls to Meituan's open API returning a body with an error_code field (auth failure, invalid appkey, signature problems).

Common situations: Wrong client credentials, sandbox/production endpoint mix-up, or API permissions not granted for the Meituan developer app. Developers also hit this when debugging why the exception message is empty — that is the 'erroe_msg' typo.

Related errors


AI-assisted analysis of justauth/JustAuth@694bbf1b01 (2026-08-14). Data as JSON: /api/errors/0d703d262fa2e893. Report an issue: GitHub.