Skip to content

Commit 1dbf369

Browse files
authored
Log catched useFetch errors (#5291)
Because we don't always handle them in the UI code and we need to be aware of them when they happen regardless.
1 parent e27c09e commit 1dbf369

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/frontend/src/hooks/useFetch.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { useCallback, useEffect, useMemo, useState } from 'react'
22
import { BackendRemote } from '../backend-com'
3+
import { getLogger } from '@deltachat-desktop/shared/logger'
4+
5+
const log = getLogger('renderer/hooks/useFetch')
36

47
/**
58
* Possible results of an async operation - either success with a value
@@ -141,6 +144,11 @@ export function useFetchGeneric<F extends AsyncFNoArgs>(
141144
result: { ok: false, err },
142145
fetchId,
143146
})
147+
log.errorWithoutStackTrace(
148+
'error while executing fetch',
149+
err,
150+
fetchId
151+
)
144152
}
145153
})
146154

0 commit comments

Comments
 (0)