Commit 79ad818
authored
Improve Apollo error handling and log missing repositories gracefully
Previously, uncaught ApolloErrors — especially those triggered by exceeding
the GitHub API rate limit — surfaced as unhandled promise rejections.
This caused confusing, bloated error stacks in the console and toast messages,
detracting from the user experience and masking the root issue.
Let’s unwrap promise rejections at the top level and explicitly detect Apollo errors.
By inspecting graphQLErrors and networkError, we can now display
clear, user-friendly messages when rate limits are hit or data is unavailable.
Additionally, GraphQL responses sometimes lacked repository fields,
often due to upstream errors or permission issues.
The previous implementation assumed response.body.data.repository would exist,
causing runtime crashes or broken logic when it didn’t.
Let’s add guards and structured logging to flag when repositories are missing,
including relevant operationName context to help with debugging.1 parent 10b44b1 commit 79ad818
File tree
2 files changed
+70
-8
lines changed- src/app
- core/services
2 files changed
+70
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
90 | 96 | | |
91 | 97 | | |
92 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
93 | 101 | | |
| 102 | + | |
94 | 103 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
98 | 118 | | |
99 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
100 | 122 | | |
101 | 123 | | |
102 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
19 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
20 | 59 | | |
| 60 | + | |
21 | 61 | | |
22 | 62 | | |
23 | 63 | | |
| |||
26 | 66 | | |
27 | 67 | | |
28 | 68 | | |
29 | | - | |
| 69 | + | |
30 | 70 | | |
31 | 71 | | |
32 | 72 | | |
| |||
0 commit comments