File tree Expand file tree Collapse file tree 9 files changed +15
-55
lines changed
packages/hoppscotch-common/src
helpers/backend/mutations Expand file tree Collapse file tree 9 files changed +15
-55
lines changed Original file line number Diff line number Diff line change @@ -141,29 +141,17 @@ const importToPersonalWorkspace = async (collections: HoppCollection[]) => {
141141 // Replace local collections with backend collections
142142 setRESTCollections (fetchResult .right )
143143 } else {
144- console .warn (
145- " Failed to fetch collections from backend after import:" ,
146- fetchResult .left
147- )
148- // Still append to local store as fallback
144+ // Failed to fetch, append to local store as fallback
149145 appendRESTCollections (collections )
150146 }
151147
152148 return E .right ({ success: true })
153149 }
154150 // Backend import failed, fall back to local storage
155- console .warn (
156- " Backend import failed, falling back to local storage:" ,
157- res .left
158- )
159151 appendRESTCollections (collections )
160152 return E .right ({ success: true })
161- } catch ( error ) {
153+ } catch {
162154 // Backend import failed, fall back to local storage
163- console .warn (
164- " Backend import failed, falling back to local storage:" ,
165- error
166- )
167155 appendRESTCollections (collections )
168156 return E .right ({ success: true })
169157 }
Original file line number Diff line number Diff line change @@ -258,31 +258,19 @@ const handleImportToStore = async (gqlCollections: HoppCollection[]) => {
258258 // Replace local collections with backend collections
259259 setGraphqlCollections (fetchResult .right )
260260 } else {
261- console .warn (
262- " Failed to fetch collections from backend after import:" ,
263- fetchResult .left
264- )
265- // Still append to local store as fallback
261+ // Failed to fetch, append to local store as fallback
266262 appendGraphqlCollections (gqlCollections )
267263 }
268264
269265 toast .success (t (" state.file_imported" ))
270266 return
271267 }
272268 // Backend import failed, fall back to local storage
273- console .warn (
274- " Backend import failed, falling back to local storage:" ,
275- res .left
276- )
277269 appendGraphqlCollections (gqlCollections )
278270 toast .success (t (" state.file_imported" ))
279271 return
280- } catch ( error ) {
272+ } catch {
281273 // Backend import failed, fall back to local storage
282- console .warn (
283- " Backend import failed, falling back to local storage:" ,
284- error
285- )
286274 appendGraphqlCollections (gqlCollections )
287275 toast .success (t (" state.file_imported" ))
288276 return
Original file line number Diff line number Diff line change @@ -476,7 +476,6 @@ const createMockServer = async () => {
476476 TE .match (
477477 (error ) => {
478478 // `error` here is the message string produced by the mutation helper.
479- console .error (" Failed to create mock server:" , error )
480479 // Show the backend-provided error message if available, otherwise fallback to generic
481480 toast .error (String (error ) || t (" error.something_went_wrong" ))
482481 loading .value = false
@@ -508,8 +507,7 @@ const toggleMockServer = async () => {
508507 await pipe (
509508 updateMockServer (existingMockServer .value .id , { isActive: newActiveState }),
510509 TE .match (
511- (error ) => {
512- console .error (" Failed to update mock server:" , error )
510+ () => {
513511 toast .error (t (" error.something_went_wrong" ))
514512 loading .value = false
515513 },
Original file line number Diff line number Diff line change @@ -221,8 +221,7 @@ const updateMockServer = async () => {
221221 await pipe (
222222 updateMockServerMutation (props .mockServer .id , payload ),
223223 TE .match (
224- (error ) => {
225- console .error (" Failed to update mock server:" , error )
224+ () => {
226225 toast .error (t (" error.something_went_wrong" ))
227226 loading .value = false
228227 },
@@ -253,8 +252,7 @@ const toggleMockServer = async () => {
253252 await pipe (
254253 updateMockServerMutation (props .mockServer .id , { isActive: newActiveState }),
255254 TE .match (
256- (error ) => {
257- console .error (" Failed to update mock server:" , error )
255+ () => {
258256 toast .error (t (" error.something_went_wrong" ))
259257 loading .value = false
260258 },
Original file line number Diff line number Diff line change @@ -104,11 +104,7 @@ const formattedContent = computed(() => {
104104const copyContent = () => {
105105 if (! props .content ) return
106106
107- try {
108- copyToClipboard (formattedContent .value )
109- copySuccess .value = true
110- } catch (error ) {
111- console .error (" Failed to copy content:" , error )
112- }
107+ copyToClipboard (formattedContent .value )
108+ copySuccess .value = true
113109}
114110 </script >
Original file line number Diff line number Diff line change @@ -282,8 +282,7 @@ const toggleMockServer = async (mockServer: MockServer) => {
282282 await pipe (
283283 updateMockServerMutation (mockServer .id , { isActive: newActiveState }),
284284 TE .match (
285- (error ) => {
286- console .error (" Failed to update mock server:" , error )
285+ () => {
287286 toast .error (t (" error.something_went_wrong" ))
288287 loading .value = false
289288 },
@@ -325,8 +324,7 @@ const confirmDelete = async () => {
325324 await pipe (
326325 deleteMockServerMutation (mockServer .id ),
327326 TE .match (
328- (error ) => {
329- console .error (" Failed to delete mock server:" , error )
327+ () => {
330328 toast .error (t (" error.something_went_wrong" ))
331329 loading .value = false
332330 pendingMockServerToDelete .value = null
Original file line number Diff line number Diff line change @@ -143,8 +143,7 @@ const fetchLogs = async () => {
143143 await pipe (
144144 getMockServerLogs (props .mockServerID ),
145145 TE .match (
146- (err ) => {
147- console .error (" Failed to load logs" , err )
146+ () => {
148147 toast .error (t (" error.something_went_wrong" ))
149148 loading .value = false
150149 },
@@ -172,8 +171,7 @@ const confirmDelete = async () => {
172171 await pipe (
173172 deleteMockServerLog (logToDelete .value ),
174173 TE .match (
175- (err ) => {
176- console .error (" Failed to delete log" , err )
174+ () => {
177175 toast .error (t (" error.something_went_wrong" ))
178176 },
179177 (res ) => {
Original file line number Diff line number Diff line change @@ -224,7 +224,6 @@ export const getErrorMessage = (err: GQLError<string> | string | Error) => {
224224 if ( ! gErr ) return t ( "error.something_went_wrong" )
225225
226226 if ( gErr . type === "network_error" ) {
227- console . error ( gErr . error )
228227 return t ( "error.network_error" )
229228 }
230229
Original file line number Diff line number Diff line change @@ -77,9 +77,7 @@ function convertUserRequestToHoppRequest(
7777 }
7878
7979 return request
80- } catch ( error ) {
81- console . warn ( "Failed to parse user request data:" , error )
82-
80+ } catch {
8381 // Return a default request if parsing fails
8482 if ( userRequest . type === ReqType . Rest ) {
8583 const defaultRequest = getDefaultRESTRequest ( )
@@ -115,8 +113,7 @@ function parseUserCollectionData(data: string | null | undefined) {
115113 headers : parsedData ?. headers || defaultDataProps . headers ,
116114 variables : parsedData ?. variables || defaultDataProps . variables ,
117115 }
118- } catch ( error ) {
119- console . warn ( "Failed to parse user collection data:" , error )
116+ } catch {
120117 return defaultDataProps
121118 }
122119}
You can’t perform that action at this time.
0 commit comments