@@ -21,7 +21,7 @@ static BUCK2_RE_CLIENT_CFG_SECTION: &str = "buck2_re_client";
21
21
/// We put functions here that both things need to implement for code that isn't gated behind a
22
22
/// fbcode_build or not(fbcode_build)
23
23
pub trait RemoteExecutionStaticMetadataImpl : Sized {
24
- fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> anyhow :: Result < Self > ;
24
+ fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> buck2_error :: Result < Self > ;
25
25
fn cas_semaphore_size ( & self ) -> usize ;
26
26
}
27
27
@@ -79,7 +79,7 @@ mod fbcode {
79
79
}
80
80
81
81
impl RemoteExecutionStaticMetadataImpl for RemoteExecutionStaticMetadata {
82
- fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> anyhow :: Result < Self > {
82
+ fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> buck2_error :: Result < Self > {
83
83
Ok ( Self {
84
84
cas_address : legacy_config. parse ( BuckconfigKeyRef {
85
85
section : BUCK2_RE_CLIENT_CFG_SECTION ,
@@ -249,7 +249,7 @@ mod not_fbcode {
249
249
pub struct RemoteExecutionStaticMetadata ( pub Buck2OssReConfiguration ) ;
250
250
251
251
impl RemoteExecutionStaticMetadataImpl for RemoteExecutionStaticMetadata {
252
- fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> anyhow :: Result < Self > {
252
+ fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> buck2_error :: Result < Self > {
253
253
Ok ( Self ( Buck2OssReConfiguration :: from_legacy_config (
254
254
legacy_config,
255
255
) ?) )
@@ -313,7 +313,7 @@ pub struct HttpHeader {
313
313
}
314
314
315
315
impl FromStr for HttpHeader {
316
- type Err = anyhow :: Error ;
316
+ type Err = buck2_error :: Error ;
317
317
318
318
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
319
319
let mut iter = s. split ( ':' ) ;
@@ -322,7 +322,8 @@ impl FromStr for HttpHeader {
322
322
key : key. trim ( ) . to_owned ( ) ,
323
323
value : value. trim ( ) . to_owned ( ) ,
324
324
} ) ,
325
- _ => Err ( anyhow:: anyhow!(
325
+ _ => Err ( buck2_error:: buck2_error!(
326
+ [ ] ,
326
327
"Invalid header (expect exactly one `:`): `{}`" ,
327
328
s
328
329
) ) ,
@@ -331,7 +332,7 @@ impl FromStr for HttpHeader {
331
332
}
332
333
333
334
impl Buck2OssReConfiguration {
334
- pub fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> anyhow :: Result < Self > {
335
+ pub fn from_legacy_config ( legacy_config : & LegacyBuckConfig ) -> buck2_error :: Result < Self > {
335
336
// this is used for all three services by default, if given; if one of
336
337
// them has an explicit address given as well though, use that instead
337
338
let default_address: Option < String > = legacy_config. parse ( BuckconfigKeyRef {
0 commit comments