Skip to content

Commit

Permalink
Fixes after #3604
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Jan 18, 2023
1 parent d57824e commit 709c831
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions query-engine/core/src/interactive_transactions/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
use thiserror::Error;

use crate::{
response_ir::{Item, Map},
CoreError,
};

#[derive(Debug, Error, PartialEq)]
pub enum TransactionError {
#[error("Unable to start a transaction in the given time.")]
Expand All @@ -24,17 +29,17 @@ pub struct ExtendedTransactionUserFacingError {
user_facing_error: user_facing_errors::Error,

#[serde(skip_serializing_if = "indexmap::IndexMap::is_empty")]
extensions: crate::Map,
extensions: Map,
}

impl ExtendedTransactionUserFacingError {
pub fn set_extension(&mut self, key: String, val: serde_json::Value) {
self.extensions.entry(key).or_insert(crate::Item::Json(val));
self.extensions.entry(key).or_insert(Item::Json(val));
}
}

impl From<crate::CoreError> for ExtendedTransactionUserFacingError {
fn from(error: crate::CoreError) -> Self {
impl From<CoreError> for ExtendedTransactionUserFacingError {
fn from(error: CoreError) -> Self {
ExtendedTransactionUserFacingError {
user_facing_error: error.into(),
extensions: Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions query-engine/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub mod telemetry;

pub use self::{
error::{CoreError, FieldConversionError},
executor::QueryExecutor,
interactive_transactions::{TransactionError, TxId},
executor::{QueryExecutor, TransactionOptions},
interactive_transactions::{ExtendedTransactionUserFacingError, TransactionError, TxId},
query_document::*,
telemetry::*,
};
Expand Down

0 comments on commit 709c831

Please sign in to comment.