mirror of
https://codeberg.org/icewind/log-normalizer.git
synced 2026-06-03 13:54:11 +02:00
ignore logs with invalid steam ids
This commit is contained in:
parent
7c98de0109
commit
17db2f8074
1 changed files with 9 additions and 1 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -58,7 +58,15 @@ async fn get_log(pool: &PgPool, id: i32) -> Result<Option<NormalizedLog>, MainEr
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if is_valid(&row.0) {
|
if is_valid(&row.0) {
|
||||||
Ok(serde_json::from_value(row.0)?)
|
match serde_json::from_value(row.0) {
|
||||||
|
Ok(log) => Ok(Some(log)),
|
||||||
|
Err(err) => {
|
||||||
|
if format!("{}", err).starts_with("Invalid SteamID") {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
Err(err.into())
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue