v0.9.0
This commit is contained in:
@@ -111,7 +111,7 @@ impl ElasticSearchStore {
|
||||
.exists(IndicesExistsParts::Index(&[INDEX_NAMES[0]]))
|
||||
.send()
|
||||
.await
|
||||
.map_err(|err| trc::StoreEvent::ElasticSearchError.reason(err))?;
|
||||
.map_err(|err| trc::StoreEvent::ElasticsearchError.reason(err))?;
|
||||
|
||||
if exists.status_code() == StatusCode::NOT_FOUND {
|
||||
let response = self
|
||||
@@ -183,11 +183,11 @@ pub(crate) async fn assert_success(response: Result<Response, Error>) -> trc::Re
|
||||
if status.is_success() {
|
||||
Ok(response)
|
||||
} else {
|
||||
Err(trc::StoreEvent::ElasticSearchError
|
||||
Err(trc::StoreEvent::ElasticsearchError
|
||||
.reason(response.text().await.unwrap_or_default())
|
||||
.ctx(trc::Key::Code, status.as_u16()))
|
||||
}
|
||||
}
|
||||
Err(err) => Err(trc::StoreEvent::ElasticSearchError.reason(err)),
|
||||
Err(err) => Err(trc::StoreEvent::ElasticsearchError.reason(err)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,14 +107,14 @@ impl ElasticSearchStore {
|
||||
let json: Value = response
|
||||
.json()
|
||||
.await
|
||||
.map_err(|err| trc::StoreEvent::ElasticSearchError.reason(err))?;
|
||||
.map_err(|err| trc::StoreEvent::ElasticsearchError.reason(err))?;
|
||||
let mut results = RoaringBitmap::new();
|
||||
|
||||
for hit in json["hits"]["hits"].as_array().ok_or_else(|| {
|
||||
trc::StoreEvent::ElasticSearchError.reason("Invalid response from ElasticSearch")
|
||||
trc::StoreEvent::ElasticsearchError.reason("Invalid response from ElasticSearch")
|
||||
})? {
|
||||
results.insert(hit["_source"]["document_id"].as_u64().ok_or_else(|| {
|
||||
trc::StoreEvent::ElasticSearchError.reason("Invalid response from ElasticSearch")
|
||||
trc::StoreEvent::ElasticsearchError.reason("Invalid response from ElasticSearch")
|
||||
})? as u32);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ impl TimedTransaction {
|
||||
|
||||
#[inline(always)]
|
||||
fn into_error(error: FdbError) -> trc::Error {
|
||||
trc::StoreEvent::FoundationDBError
|
||||
trc::StoreEvent::FoundationdbError
|
||||
.reason(error.message())
|
||||
.ctx(trc::Key::Code, error.code())
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ impl FdbStore {
|
||||
*key.last_mut().unwrap() += 1;
|
||||
} else {
|
||||
trx.cancel();
|
||||
return Err(trc::StoreEvent::FoundationDBError
|
||||
return Err(trc::StoreEvent::FoundationdbError
|
||||
.ctx(
|
||||
trc::Key::Reason,
|
||||
"Value is too large",
|
||||
|
||||
@@ -20,5 +20,5 @@ pub struct MysqlStore {
|
||||
|
||||
#[inline(always)]
|
||||
fn into_error(err: impl Display) -> trc::Error {
|
||||
trc::StoreEvent::MySQLError.reason(err)
|
||||
trc::StoreEvent::MysqlError.reason(err)
|
||||
}
|
||||
|
||||
@@ -21,5 +21,5 @@ pub struct PostgresStore {
|
||||
|
||||
#[inline(always)]
|
||||
fn into_error(err: impl Display) -> trc::Error {
|
||||
trc::StoreEvent::PostgreSQLError.reason(err)
|
||||
trc::StoreEvent::PostgresqlError.reason(err)
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@ pub struct RocksDbStore {
|
||||
|
||||
#[inline(always)]
|
||||
fn into_error(err: rocksdb::Error) -> trc::Error {
|
||||
trc::StoreEvent::RocksDBError.reason(err)
|
||||
trc::StoreEvent::RocksdbError.reason(err)
|
||||
}
|
||||
|
||||
@@ -24,5 +24,5 @@ pub struct SqliteStore {
|
||||
|
||||
#[inline(always)]
|
||||
fn into_error(err: impl Display) -> trc::Error {
|
||||
trc::StoreEvent::SQLiteError.reason(err)
|
||||
trc::StoreEvent::SqliteError.reason(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user