This is an automated email from the ASF dual-hosted git repository.

jerryshao pushed a commit to branch branch-1.3
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/branch-1.3 by this push:
     new cb49ac5af9 [Cherry-pick to branch-1.3] [#11291] fix(web-v2): Suppress 
error toast when catalog doesn't support views (#11300) (#11315)
cb49ac5af9 is described below

commit cb49ac5af996bf4368621726b3f7d8322e5e0152
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jun 1 14:59:42 2026 +0800

    [Cherry-pick to branch-1.3] [#11291] fix(web-v2): Suppress error toast when 
catalog doesn't support views (#11300) (#11315)
    
    **Cherry-pick Information:**
    - Original commit: 417ae4753aaf86da8cd89da07b800dd5f7309fa6
    - Target branch: `branch-1.3`
    - Status: ✅ Clean cherry-pick (no conflicts)
    
    Co-authored-by: Bharath Krishna <[email protected]>
---
 web-v2/web/src/lib/api/views/index.js       | 22 ++++++++++++++--------
 web-v2/web/src/lib/store/metalakes/index.js | 23 ++++++++++++++++++-----
 2 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/web-v2/web/src/lib/api/views/index.js 
b/web-v2/web/src/lib/api/views/index.js
index bcb9154466..13adf40fc8 100644
--- a/web-v2/web/src/lib/api/views/index.js
+++ b/web-v2/web/src/lib/api/views/index.js
@@ -34,16 +34,22 @@ const Apis = {
     )}/schemas/${encodeURIComponent(schema)}/views/${encodeURIComponent(view)}`
 }
 
-export const getViewsApi = params => {
-  return defHttp.get({
-    url: `${Apis.GET(params)}`
-  })
+export const getViewsApi = (params, options) => {
+  return defHttp.get(
+    {
+      url: `${Apis.GET(params)}`
+    },
+    options
+  )
 }
 
-export const getViewDetailsApi = ({ metalake, catalog, schema, view }) => {
-  return defHttp.get({
-    url: `${Apis.GET_DETAIL({ metalake, catalog, schema, view })}`
-  })
+export const getViewDetailsApi = ({ metalake, catalog, schema, view }, 
options) => {
+  return defHttp.get(
+    {
+      url: `${Apis.GET_DETAIL({ metalake, catalog, schema, view })}`
+    },
+    options
+  )
 }
 
 export const deleteViewApi = ({ metalake, catalog, schema, view }) => {
diff --git a/web-v2/web/src/lib/store/metalakes/index.js 
b/web-v2/web/src/lib/store/metalakes/index.js
index 3f92b24abc..0654be50a7 100644
--- a/web-v2/web/src/lib/store/metalakes/index.js
+++ b/web-v2/web/src/lib/store/metalakes/index.js
@@ -294,7 +294,10 @@ export const setIntoTreeNodeWithFetch = createAsyncThunk(
           break
       }
 
-      const viewsPromise = type === 'relational' ? getViewsApi({ metalake, 
catalog, schema }) : Promise.resolve(null)
+      const viewsPromise =
+        type === 'relational'
+          ? getViewsApi({ metalake, catalog, schema }, { errorMessageMode: 
'none' })
+          : Promise.resolve(null)
 
       const [funcResult, entityResult, viewResult] = await Promise.allSettled([
         getFunctionsApi({ metalake, catalog, schema, details: false }),
@@ -2185,10 +2188,16 @@ export const getFunctionDetails = createAsyncThunk(
 export const fetchViews = createAsyncThunk(
   'appMetalakes/fetchViews',
   async ({ init, metalake, catalog, schema }, { getState, dispatch }) => {
-    const [err, res] = await to(getViewsApi({ metalake, catalog, schema }))
+    const [err, res] = await to(getViewsApi({ metalake, catalog, schema }, { 
errorMessageMode: 'none' }))
 
-    if (init && (err || !res)) {
-      throw new Error(err)
+    if (err || !res) {
+      // Catalog doesn't support views (HTTP 405) — return empty views silently
+      if (err?.response?.status === 405) {
+        return { views: [], init }
+      }
+      if (init) {
+        throw new Error(err)
+      }
     }
 
     const { identifiers = [] } = res || {}
@@ -2233,9 +2242,13 @@ export const fetchViews = createAsyncThunk(
 export const getViewDetails = createAsyncThunk(
   'appMetalakes/getViewDetails',
   async ({ init, metalake, catalog, schema, view }) => {
-    const [err, res] = await to(getViewDetailsApi({ metalake, catalog, schema, 
view }))
+    const [err, res] = await to(getViewDetailsApi({ metalake, catalog, schema, 
view }, { errorMessageMode: 'none' }))
 
     if (err || !res) {
+      // Catalog doesn't support views (HTTP 405) — return empty result 
silently
+      if (err?.response?.status === 405) {
+        return { view: null, init }
+      }
       throw new Error(err)
     }
 

Reply via email to