Skip to content

Commit 8e9df1a

Browse files
committed
Refactor error handling in SQL snippets loading
- Simplify error handling in SqlSnippets.vue and Subscribers.vue by removing console error logs. - Implement silent failure for loading subscriber counts and SQL snippets, ensuring the application remains functional without displaying error messages. - Set default values for sqlSnippets to an empty array on failure to enhance user experience.
1 parent 8145ee9 commit 8e9df1a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

frontend/src/views/SqlSnippets.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,7 @@ export default {
425425
this.subscriberCount.total = response.total || 0;
426426
this.subscriberCount.loading = false;
427427
this.subscriberCount.error = false;
428-
}).catch((err) => {
429-
console.error('Error counting subscribers:', err);
428+
}).catch(() => {
430429
this.subscriberCount.loading = false;
431430
this.subscriberCount.error = true;
432431
});
@@ -437,8 +436,8 @@ export default {
437436
// Load total subscriber count on page load
438437
this.$api.countSQLSnippet({ query_sql: '' }).then((response) => {
439438
this.subscriberCount.total = response.total || 0;
440-
}).catch((err) => {
441-
console.error('Error loading total subscriber count:', err);
439+
}).catch(() => {
440+
// Silently fail for total count loading
442441
});
443442
},
444443

frontend/src/views/Subscribers.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ export default Vue.extend({
302302
this.$api.getSQLSnippets({ is_active: true }).then((data) => {
303303
// API returns the array directly, not wrapped in results
304304
this.sqlSnippets = data || [];
305-
}).catch((err) => {
306-
console.error('Error loading SQL snippets:', err);
307-
console.error('Error details:', err.response || err);
305+
}).catch(() => {
306+
// Silently fail for SQL snippets loading - this is optional functionality
307+
this.sqlSnippets = [];
308308
});
309309
},
310310

0 commit comments

Comments
 (0)