Skip to content

Commit

Permalink
workaround new_task_join_error depends on tokio rt
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Jan 23, 2024
1 parent 64362a0 commit b4a8bb6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/src/raw/tokio_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
// specific language governing permissions and limitations
// under the License.

use crate::*;
use crate::{Error, ErrorKind};

/// Parse tokio error into opendal::Error.
pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
// HACK - tokio::task::JoinError is not always present, use an existential type.
pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {
Error::new(ErrorKind::Unexpected, "tokio task join failed").set_source(e)
}

0 comments on commit b4a8bb6

Please sign in to comment.