public static TokenRequestException parse(String rawResponse) {
        final LinkedHashMap<String, String> map;
        try {
            map = JSON.readValue(rawResponse, MAP_TYPE);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }

        final String errorDescription = map.get(ERROR_DESCRIPTION);
        final String errorUri = map.get(ERROR_URI);
        final String errorType = map.get(ERROR);
        if (errorType != null) {
            switch (errorType.toLowerCase()) {
                case INVALID_REQUEST:
                    return new InvalidRequestException(errorDescription, errorUri);
                case INVALID_CLIENT:
                    return new InvalidClientException(errorDescription, errorUri);
                case INVALID_GRANT:
                    return new InvalidGrantException(errorDescription, errorUri);
                case UNAUTHORIZED_CLIENT:
                    return new UnauthorizedClientException(errorDescription, errorUri);
                case UNSUPPORTED_GRANT_TYPE:
                    return new UnsupportedGrantTypeException(errorDescription, errorUri);
                case INVALID_SCOPE:
                    return new InvalidScopeException(errorDescription, errorUri);
                case UNSUPPORTED_TOKEN_TYPE:
                    return new UnsupportedTokenTypeException(errorDescription, errorUri);
            }
        }
        return new TokenRequestException(errorDescription, errorUri);
    }
Parses {@code JSON} error response body and created a new instance of {@link TokenRequestException}
using the response data. Returns an error-specific type of {@link TokenRequestException}.
@param rawResponse {@code JSON} formatted error response body.
@return a new instance of {@link TokenRequestException}
oauth2/src/main/java/com/linecorp/armeria/common/auth/oauth2/TokenRequestException.java