[core] refactor util::toString to use RapidJSON's stringification

This commit is contained in:
Konstantin Käfer
2018-10-18 21:02:17 +02:00
parent 59c5754fa8
commit 7692be5d15
4 changed files with 116 additions and 55 deletions

View File

@@ -151,9 +151,9 @@ void HTTPRequest::onResponse(jni::JNIEnv& env, int code,
}
response.error = std::make_unique<Error>(Error::Reason::RateLimit, "HTTP status code 429", http::parseRetryHeaders(retryAfter, xRateLimitReset));
} else if (code >= 500 && code < 600) {
response.error = std::make_unique<Error>(Error::Reason::Server, std::string{ "HTTP status code " } + std::to_string(code));
response.error = std::make_unique<Error>(Error::Reason::Server, std::string{ "HTTP status code " } + util::toString(code));
} else {
response.error = std::make_unique<Error>(Error::Reason::Other, std::string{ "HTTP status code " } + std::to_string(code));
response.error = std::make_unique<Error>(Error::Reason::Other, std::string{ "HTTP status code " } + util::toString(code));
}
async.send();