jabbera commented on code in PR #46095: URL: https://github.com/apache/arrow/pull/46095#discussion_r2066384369
########## cpp/src/arrow/filesystem/azurefs.cc: ########## @@ -570,6 +570,16 @@ bool IsContainerNotFound(const Storage::StorageException& e) { return false; } +bool IsForbidden(const Storage::StorageException& e) { + // In some situations, only the ReasonPhrase is set and the + // ErrorCode is empty, so we check both. + if (e.ErrorCode == "AuthorizationFailure" || + e.ReasonPhrase == "This request is not authorized to perform this operation.") { + DCHECK_EQ(e.StatusCode, Http::HttpStatusCode::Forbidden); + } Review Comment: I don't know. I copied that code from the function directly above, copied below. Happy to remove it, but I figured someone wrote it that way for a reason. bool IsContainerNotFound(const Storage::StorageException& e) { // In some situations, only the ReasonPhrase is set and the // ErrorCode is empty, so we check both. if (e.ErrorCode == "ContainerNotFound" || e.ReasonPhrase == "The specified container does not exist." || e.ReasonPhrase == "The specified filesystem does not exist.") { DCHECK_EQ(e.StatusCode, Http::HttpStatusCode::NotFound); return true; } return 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org