{"record":{"id":"0d703d262fa2e893","repo":"justauth/JustAuth","slug":"object-getstring-erroe-msg","errorCode":null,"errorMessage":"object.getString(\"erroe_msg\")","messagePattern":"object\\.getString\\(\"erroe_msg\"\\)","errorType":"exception","errorClass":"AuthException","httpStatus":null,"severity":"error","filePath":"src/main/java/me/zhyd/oauth/request/AuthMeituanRequest.java","lineNumber":105,"sourceCode":"\n        String response = new HttpUtils(config.getHttpConfig()).post(source.refresh(), form, false).getBody();\n        JSONObject object = JSONObject.parseObject(response);\n\n        this.checkResponse(object);\n\n        return AuthResponse.<AuthToken>builder()\n            .code(AuthResponseStatus.SUCCESS.getCode())\n            .data(AuthToken.builder()\n                .accessToken(object.getString(\"access_token\"))\n                .refreshToken(object.getString(\"refresh_token\"))\n                .expireIn(object.getIntValue(\"expires_in\"))\n                .build())\n            .build();\n    }\n\n    private void checkResponse(JSONObject object) {\n        if (object.containsKey(\"error_code\")) {\n            throw new AuthException(object.getString(\"erroe_msg\"));\n        }\n    }\n\n    @Override\n    public String authorize(String state) {\n        return UrlBuilder.fromBaseUrl(super.authorize(state))\n            .queryParam(\"scope\", \"\")\n            .build();\n    }\n\n}\n","sourceCodeStart":87,"sourceCodeEnd":117,"githubUrl":"https://github.com/justauth/JustAuth/blob/694bbf1b010d93404e3bfb4824d90e9ddfaebebb/src/main/java/me/zhyd/oauth/request/AuthMeituanRequest.java#L87-L117","documentation":"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.","triggerScenarios":"Token or user-info calls to Meituan's open API returning a body with an error_code field (auth failure, invalid appkey, signature problems).","commonSituations":"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.","solutions":["Log the whole AuthException including cause; if message is null, capture the raw HTTP response to see Meituan's real error fields","Verify AuthConfig clientId/clientSecret for the Meituan open platform","If you control the dependency, patch/upgrade JustAuth so the key is spelled 'error_msg'","Check Meituan's error_code value against their open-platform docs"],"exampleFix":"// before (JustAuth internal, message may be null)\nthrow new AuthException(object.getString(\"erroe_msg\"));\n\n// after (fixed key)\nthrow new AuthException(object.getString(\"error_msg\"));","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n    meituanRequest.getAuthResponse(callback);\n} catch (AuthException e) {\n    log.warn(\"Meituan error_code present, message (may be null due to key typo): {}\", e.getMessage());\n    // capture raw response via your own HttpConfig interceptor for real diagnostics\n}","preventionTips":["Add an HTTP logging interceptor in AuthConfig.httpConfig to capture Meituan raw bodies (the exception message may be null due to the erroe_msg typo)","Verify credentials and app approval on Meituan open platform","Track JustAuth upstream fix for the 'erroe_msg' key and upgrade"],"tags":["oauth","meituan","typo-bug","auth-exception"],"backgroundTag":null,"analyzedSha":"694bbf1b010d93404e3bfb4824d90e9ddfaebebb","analyzedAt":"2026-08-14T15:16:59.945Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}