Skip to content

Commit

Permalink
do not re-export and refine docs
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Feb 2, 2024
1 parent b88a8e4 commit e91e806
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/frontend/src/binder/bind_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
use bytes::Bytes;
use pgwire::types::{Format, FormatIterator};
use risingwave_common::bail;
use risingwave_common::error::BoxedError;
use risingwave_common::types::{Datum, ScalarImpl};

use super::statement::RewriteExprsRecursive;
use super::BoundStatement;
use crate::error::{BoxedError, ErrorCode, Result};
use crate::error::{ErrorCode, Result};
use crate::expr::{Expr, ExprImpl, ExprRewriter, Literal};

/// Rewrites parameter expressions to literals.
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/catalog/system_catalog/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use risingwave_common::catalog::{
ColumnCatalog, ColumnDesc, Field, SysCatalogReader, TableDesc, TableId, DEFAULT_SUPER_USER_ID,
NON_RESERVED_SYS_CATALOG_ID,
};
use risingwave_common::error::BoxedError;
use risingwave_common::row::OwnedRow;
use risingwave_common::types::DataType;
use risingwave_pb::meta::list_table_fragment_states_response::TableFragmentState;
Expand All @@ -37,7 +38,6 @@ use crate::catalog::system_catalog::information_schema::*;
use crate::catalog::system_catalog::pg_catalog::*;
use crate::catalog::system_catalog::rw_catalog::*;
use crate::catalog::view_catalog::ViewCatalog;
use crate::error::BoxedError;
use crate::meta_client::FrontendMetaClient;
use crate::scheduler::worker_node_manager::WorkerNodeManagerRef;
use crate::session::AuthContext;
Expand Down
24 changes: 23 additions & 1 deletion src/frontend/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
// Copyright 2024 RisingWave Labs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

use risingwave_batch::error::BatchError;
use risingwave_common::array::ArrayError;
pub use risingwave_common::error::*;
use risingwave_common::error::{BoxedError, NoFunction, NotImplemented};
use risingwave_common::session_config::SessionConfigError;
use risingwave_common::util::value_encoding::error::ValueEncodingError;
use risingwave_connector::sink::SinkError;
Expand All @@ -10,6 +24,13 @@ use risingwave_rpc_client::error::{RpcError, TonicStatusWrapper};
use thiserror::Error;
use thiserror_ext::Box;

/// The error type for the frontend crate, acting as the top-level error type for the
/// entire RisingWave project.
// TODO(error-handling): this is migrated from the `common` crate, and there could
// be some further refactoring to do:
// - Some variants are never constructed.
// - Some variants store a type-erased `BoxedError` to resolve the reverse dependency.
// It's not necessary anymore as the error type is now defined at the top-level.
#[derive(Error, Debug, Box)]
#[thiserror_ext(newtype(name = RwError, backtrace, report_debug))]
pub enum ErrorCode {
Expand Down Expand Up @@ -144,6 +165,7 @@ pub enum ErrorCode {
),
}

/// The result type for the frontend crate.
pub type Result<T> = std::result::Result<T, RwError>;

impl From<TonicStatusWrapper> for RwError {
Expand Down

0 comments on commit e91e806

Please sign in to comment.