thinkharderdev commented on issue #5345:
URL: https://github.com/apache/arrow-rs/issues/5345#issuecomment-1916803527
Note that there is currently a workaround since the you can parse the status
code from the error display format but you have to do something like this which
is quite hacky :)
```
pub fn is_permission_denied_error(error: &object_store::Error) -> bool {
match error {
object_store::Error::Generic { source, .. } => {
let mut inner: &dyn StdError = source.as_ref();
loop {
if let Some(err) = inner.downcast_ref::<reqwest::Error>() {
return matches!(err.status(),
Some(StatusCode::FORBIDDEN));
}
if format!("{inner}").contains("Client error with status
403") {
return true;
}
if let Some(err) = inner.source() {
inner = err;
} else {
return false;
}
}
}
_ => false,
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]