refactor: separate SchemaCacheError from ApiRequestError (#4010)

This commit is contained in:
Taimoor Zaeem
2025-04-13 10:34:17 -05:00
committed by GitHub
parent a6e81a5241
commit a1009d1bae
3 changed files with 109 additions and 84 deletions
+1 -1
View File
@@ -231,7 +231,7 @@ actionResponse (MaybeDbResult InspectPlan{ipHdrsOnly=headersOnly} body) _ versio
actionResponse (NoDbResult (RelInfoPlan qi@QualifiedIdentifier{..})) _ _ _ SchemaCache{dbTables} _ _ =
case HM.lookup qi dbTables of
Just tbl -> respondInfo $ allowH tbl
Nothing -> Left $ Error.ApiRequestError $ Error.TableNotFound qiSchema qiName (HM.elems dbTables)
Nothing -> Left $ Error.SchemaCacheErr $ Error.TableNotFound qiSchema qiName (HM.elems dbTables)
where
allowH table =
let hasPK = not . null $ tablePKCols table in