Skip to content

Commit

Permalink
fix: don't throw away the underlying error
Browse files Browse the repository at this point in the history
  • Loading branch information
imor committed Sep 13, 2023
1 parent 7df8f4b commit 1dffd1d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions supabase-wrappers/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ pub fn report_error(code: PgSqlErrorCode, msg: &str) {

#[derive(Error, Debug)]
pub enum CreateRuntimeError {
#[error("failed to create async runtime")]
FailedToCreateAsyncRuntime,
#[error("failed to create async runtime: {0}")]
FailedToCreateAsyncRuntime(#[from] std::io::Error),
}

impl From<CreateRuntimeError> for ErrorReport {
Expand Down Expand Up @@ -148,10 +148,7 @@ impl From<CreateRuntimeError> for ErrorReport {
/// ```
#[inline]
pub fn create_async_runtime() -> Result<Runtime, CreateRuntimeError> {
Builder::new_current_thread()
.enable_all()
.build()
.map_err(|_| CreateRuntimeError::FailedToCreateAsyncRuntime)
Ok(Builder::new_current_thread().enable_all().build()?)
}

/// Get required option value from the `options` map
Expand Down

0 comments on commit 1dffd1d

Please sign in to comment.