Skip to content

Commit

Permalink
Remove SQLExceptionHandler (#20205)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Aug 15, 2022
1 parent 17f73bc commit c12f35d
Show file tree
Hide file tree
Showing 61 changed files with 127 additions and 166 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect;
package org.apache.shardingsphere.error.exception;

import org.apache.shardingsphere.infra.util.exception.ShardingSphereInsideException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.connection;
package org.apache.shardingsphere.error.exception.connection;

import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Too many connections exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.data;
package org.apache.shardingsphere.error.exception.data;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Insert columns and values mismatched exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.data;
package org.apache.shardingsphere.error.exception.data;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Invalid parameter value exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.syntax.database;
package org.apache.shardingsphere.error.exception.syntax.database;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Database create exists exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.syntax.database;
package org.apache.shardingsphere.error.exception.syntax.database;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Database drop exists exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.syntax.database;
package org.apache.shardingsphere.error.exception.syntax.database;

import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* No database selected exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.syntax.database;
package org.apache.shardingsphere.error.exception.syntax.database;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Unknown database exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.syntax.table;
package org.apache.shardingsphere.error.exception.syntax.table;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* No such table exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.syntax.table;
package org.apache.shardingsphere.error.exception.syntax.table;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Table exists exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.transaction;
package org.apache.shardingsphere.error.exception.transaction;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* In transaction exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.shardingsphere.error.dialect.transaction;
package org.apache.shardingsphere.error.exception.transaction;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;

/**
* Table modify in transaction exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.shardingsphere.error.mapper;

import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.SQLDialectException;
import org.apache.shardingsphere.infra.util.spi.annotation.SingletonSPI;
import org.apache.shardingsphere.infra.util.spi.type.typed.TypedSPI;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@

package org.apache.shardingsphere.error.mysql.mapper;

import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.dialect.connection.TooManyConnectionsException;
import org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
import org.apache.shardingsphere.error.dialect.syntax.database.DatabaseDropNotExistsException;
import org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
import org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.error.exception.SQLDialectException;
import org.apache.shardingsphere.error.exception.connection.TooManyConnectionsException;
import org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
import org.apache.shardingsphere.error.exception.syntax.database.DatabaseDropNotExistsException;
import org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapper;
import org.apache.shardingsphere.error.mysql.code.MySQLVendorError;
import org.apache.shardingsphere.infra.util.exception.sql.UnknownSQLException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

import org.apache.shardingsphere.error.mapper.SQLDialectExceptionMapper;
import org.apache.shardingsphere.error.postgresql.code.PostgreSQLVendorError;
import org.apache.shardingsphere.error.dialect.transaction.InTransactionException;
import org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.error.dialect.data.InvalidParameterValueException;
import org.apache.shardingsphere.error.dialect.connection.TooManyConnectionsException;
import org.apache.shardingsphere.error.dialect.syntax.database.DatabaseCreateExistsException;
import org.apache.shardingsphere.error.dialect.SQLDialectException;
import org.apache.shardingsphere.error.exception.transaction.InTransactionException;
import org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.error.exception.data.InvalidParameterValueException;
import org.apache.shardingsphere.error.exception.connection.TooManyConnectionsException;
import org.apache.shardingsphere.error.exception.syntax.database.DatabaseCreateExistsException;
import org.apache.shardingsphere.error.exception.SQLDialectException;
import org.postgresql.util.PSQLException;
import org.postgresql.util.PSQLState;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.shardingsphere.infra.binder.statement.dml.SelectStatementContext;
import org.apache.shardingsphere.infra.datetime.DatetimeService;
import org.apache.shardingsphere.infra.datetime.DatetimeServiceFactory;
import org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.route.engine.condition.ExpressionConditionUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.infra.route.context.RouteContext;
import org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
import org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import org.apache.shardingsphere.sharding.route.engine.validator.ShardingStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexSegment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.shardingsphere.infra.binder.segment.insert.values.InsertSelectContext;
import org.apache.shardingsphere.infra.binder.segment.insert.values.InsertValueContext;
import org.apache.shardingsphere.infra.binder.statement.dml.InsertStatementContext;
import org.apache.shardingsphere.error.dialect.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.error.exception.data.InsertColumnsAndValuesMismatchedException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.route.engine.condition.ShardingCondition;
import org.apache.shardingsphere.sharding.route.engine.condition.engine.impl.InsertClauseShardingConditionEngine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.database.DefaultDatabase;
import org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
import org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateFunctionStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.apache.shardingsphere.infra.exception.ShardingSphereException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereTable;
import org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateIndexStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sql.parser.sql.common.segment.ddl.index.IndexNameSegment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
import org.apache.shardingsphere.infra.database.DefaultDatabase;
import org.apache.shardingsphere.error.dialect.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
import org.apache.shardingsphere.error.exception.syntax.table.NoSuchTableException;
import org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateProcedureStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.shardingsphere.infra.route.context.RouteContext;
import org.apache.shardingsphere.infra.route.context.RouteMapper;
import org.apache.shardingsphere.infra.route.context.RouteUnit;
import org.apache.shardingsphere.error.dialect.syntax.table.TableExistsException;
import org.apache.shardingsphere.error.exception.syntax.table.TableExistsException;
import org.apache.shardingsphere.sharding.route.engine.validator.ddl.impl.ShardingCreateTableStatementValidator;
import org.apache.shardingsphere.sharding.rule.ShardingRule;
import org.apache.shardingsphere.sharding.rule.TableRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.type.TableAvailable;
import org.apache.shardingsphere.infra.database.type.DatabaseTypeEngine;
import org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.sql.parser.sql.common.extractor.TableExtractor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import org.apache.shardingsphere.infra.binder.statement.CommonSQLStatementContext;
import org.apache.shardingsphere.infra.binder.type.TableAvailable;
import org.apache.shardingsphere.infra.binder.type.WhereAvailable;
import org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.error.dialect.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.error.exception.syntax.database.UnknownDatabaseException;
import org.apache.shardingsphere.infra.metadata.database.ShardingSphereDatabase;
import org.apache.shardingsphere.infra.metadata.database.schema.decorator.model.ShardingSphereSchema;
import org.apache.shardingsphere.sql.parser.sql.common.constant.ParameterMarkerType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.apache.shardingsphere.proxy.backend.communication.jdbc.statement.JDBCBackendStatement;
import org.apache.shardingsphere.proxy.backend.context.BackendExecutorContext;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.proxy.backend.session.transaction.TransactionStatus;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CloseStatement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.apache.shardingsphere.proxy.backend.communication.vertx.executor.ProxyReactiveExecutor;
import org.apache.shardingsphere.proxy.backend.context.BackendExecutorContext;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.error.dialect.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.error.exception.transaction.TableModifyInTransactionException;
import org.apache.shardingsphere.proxy.backend.session.transaction.TransactionStatus;
import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.apache.shardingsphere.infra.state.StateContext;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource;
import org.apache.shardingsphere.error.dialect.syntax.database.NoDatabaseSelectedException;
import org.apache.shardingsphere.error.exception.syntax.database.NoDatabaseSelectedException;

import java.util.Collection;
import java.util.LinkedList;
Expand Down
Loading

0 comments on commit c12f35d

Please sign in to comment.