Skip to content

Commit bfba8cc

Browse files
committed
Make soft_error! return Ok in OSS builds and remove .unwrap() at call sites
1 parent e40cb04 commit bfba8cc

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

app/buck2_env/src/soft_error.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,6 @@ pub fn handle_soft_error(
291291
return Err(err.context("Upgraded warning to failure via $BUCK2_HARD_ERROR"));
292292
}
293293

294-
// @oss-disable: let is_open_source = false;
295-
let is_open_source = true; // @oss-enable
296-
if is_open_source {
297-
// We don't log these, and we have no legacy users, and they might not upgrade that often,
298-
// so lets just break open source things immediately.
299-
return Err(err);
300-
}
301-
302294
Ok(err)
303295
}
304296

app/buck2_execute_impl/src/sqlite/incremental_state_db.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,15 @@ impl IncrementalDbState {
7171

7272
self.state.insert(key.to_owned(), value.clone().into());
7373
if let Err(e) = db.incremental_state_table().insert(key.to_owned(), value) {
74-
soft_error!(
74+
let _unused = soft_error!(
7575
"insert_to_incremental_db",
7676
buck2_error::buck2_error!(
7777
buck2_error::ErrorTag::Tier0,
7878
"Failed to insert {} into sqlite db. {}",
7979
key, e
8080
),
8181
quiet: true
82-
)
83-
.unwrap();
82+
);
8483
};
8584
}
8685
None => {
@@ -95,16 +94,15 @@ impl IncrementalDbState {
9594
{
9695
// This should be converted into a real error later, marking as a soft error for now as the row not existing
9796
// might show up as an error but doesn't actually matter in reality.
98-
soft_error!(
97+
let _unused = soft_error!(
9998
"delete_from_incremental_db",
10099
buck2_error::buck2_error!(
101100
buck2_error::ErrorTag::Tier0,
102101
"Failed to remove incremental path map from sqlite db. {}",
103102
e
104103
),
105104
quiet: true
106-
)
107-
.unwrap();
105+
);
108106
}
109107

110108
self.state.remove(key);

0 commit comments

Comments
 (0)