Skip to content

Commit

Permalink
[#63] TypeError 재작성
Browse files Browse the repository at this point in the history
  • Loading branch information
myyrakle committed Mar 24, 2024
1 parent f2733ca commit 5220fe7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
2 changes: 0 additions & 2 deletions src/errors/execute_error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::error::Error;

use super::RRDBError;

#[derive(Clone, Debug, PartialEq, Eq)]
Expand Down
16 changes: 4 additions & 12 deletions src/errors/type_error.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
use std::error::Error;
use super::RRDBError;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct TypeError {
pub message: String,
}

impl TypeError {
pub fn new<T: ToString>(message: T) -> Self {
Self {
pub fn new<T: ToString>(message: T) -> RRDBError {
RRDBError::TypeError(Self {
message: message.to_string(),
}
}

pub fn boxed<T: ToString>(message: T) -> Box<Self> {
Box::new(Self::new(message))
}

pub fn dyn_boxed<T: ToString>(message: T) -> RRDBError {
Box::new(Self::new(message))
})
}
}

Expand Down
1 change: 0 additions & 1 deletion src/executor/common.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::error::Error;
use std::io::ErrorKind;

use super::config::table::TableConfig;
Expand Down
2 changes: 0 additions & 2 deletions src/executor/executor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::error::Error;

use crate::ast::ddl::create_database::CreateDatabaseQuery;
use crate::ast::{DDLStatement, DMLStatement, OtherStatement, SQLStatement};
use crate::errors::execute_error::ExecuteError;
Expand Down
2 changes: 1 addition & 1 deletion src/executor/implements/dml/insert.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::collections::HashSet;
use std::error::Error;
use std::io::ErrorKind;

use crate::ast::dml::insert::{InsertData, InsertQuery};
use crate::ast::types::SQLExpression;
use crate::errors::predule::ExecuteError;
use crate::errors::RRDBError;
use crate::executor::config::row::{TableDataField, TableDataRow};
use crate::executor::config::table::TableConfig;
use crate::executor::encoder::storage::StorageEncoder;
Expand Down
2 changes: 1 addition & 1 deletion src/executor/reduce.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


use std::collections::HashMap;
use std::error::Error;

use futures::future::join_all;
use itertools::Itertools;
Expand All @@ -10,6 +9,7 @@ use crate::ast::dml::expressions::binary::BinaryOperatorExpression;
use crate::ast::dml::expressions::operators::{BinaryOperator, UnaryOperator};
use crate::ast::types::{ AggregateFunction, BuiltInFunction, Column, Function, SQLExpression, TableName};
use crate::errors::predule::{TypeError, ExecuteError};
use crate::errors::RRDBError;
use crate::executor::predule::{ Executor, ExecuteColumnType};

use super::config::row::{TableDataFieldType, TableDataRow};
Expand Down

0 comments on commit 5220fe7

Please sign in to comment.