mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-30 20:00:36 +00:00
feat: add trigger-related error code (#6419)
This commit is contained in:
@@ -807,6 +807,8 @@ pub fn status_code_to_http_status(status_code: &StatusCode) -> HttpStatusCode {
|
||||
| StatusCode::TableColumnNotFound
|
||||
| StatusCode::PlanQuery
|
||||
| StatusCode::DatabaseAlreadyExists
|
||||
| StatusCode::TriggerAlreadyExists
|
||||
| StatusCode::TriggerNotFound
|
||||
| StatusCode::FlowNotFound
|
||||
| StatusCode::FlowAlreadyExists => HttpStatusCode::BAD_REQUEST,
|
||||
|
||||
|
||||
@@ -369,5 +369,7 @@ fn mysql_error_kind(status_code: &StatusCode) -> ErrorKind {
|
||||
StatusCode::RateLimited => ErrorKind::ER_TOO_MANY_CONCURRENT_TRXS,
|
||||
StatusCode::FlowAlreadyExists => ErrorKind::ER_TABLE_EXISTS_ERROR,
|
||||
StatusCode::FlowNotFound => ErrorKind::ER_NO_SUCH_TABLE,
|
||||
StatusCode::TriggerAlreadyExists => ErrorKind::ER_TABLE_EXISTS_ERROR,
|
||||
StatusCode::TriggerNotFound => ErrorKind::ER_NO_SUCH_TABLE,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -389,11 +389,13 @@ impl From<StatusCode> for PgErrorCode {
|
||||
// ====== End of SQL & query related status code ===========
|
||||
|
||||
// ====== Begin of catalog & flow related status code =====
|
||||
StatusCode::TableNotFound | StatusCode::FlowNotFound | StatusCode::RegionNotFound => {
|
||||
PgErrorCode::Ec42P01
|
||||
}
|
||||
StatusCode::TableNotFound
|
||||
| StatusCode::FlowNotFound
|
||||
| StatusCode::RegionNotFound
|
||||
| StatusCode::TriggerNotFound => PgErrorCode::Ec42P01,
|
||||
StatusCode::TableAlreadyExists
|
||||
| StatusCode::FlowAlreadyExists
|
||||
| StatusCode::TriggerAlreadyExists
|
||||
| StatusCode::RegionAlreadyExists => PgErrorCode::Ec42P07,
|
||||
|
||||
StatusCode::TableColumnNotFound => PgErrorCode::Ec42703,
|
||||
|
||||
Reference in New Issue
Block a user