Skip to content

Commit

Permalink
chore: return schema not found when schema not exists (apache#439)
Browse files Browse the repository at this point in the history
* chore: return schema not found when shcmea not exists

* refactor by CR
  • Loading branch information
chunshao90 authored Dec 1, 2022
1 parent 1dd1e97 commit bca339a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sql/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub enum Error {
source: catalog::Error,
},

#[snafu(display("Failed to find schema, name:{}", name))]
SchemaNotFound { name: String },

#[snafu(display("Failed to find table, name:{}, err:{}", name, source))]
FindTable {
name: String,
Expand Down Expand Up @@ -111,7 +114,12 @@ impl<'a> MetaProvider for CatalogMetaProvider<'a> {
name: resolved.schema,
})? {
Some(s) => s,
None => return Ok(None),
None => {
return SchemaNotFound {
name: resolved.schema,
}
.fail();
}
};

schema.table_by_name(resolved.table).context(FindTable {
Expand Down

0 comments on commit bca339a

Please sign in to comment.