Improve error logging
This commit is contained in:
parent
6885fb2b41
commit
4eabc2d65a
49 changed files with 212 additions and 188 deletions
|
@ -91,11 +91,14 @@ export class VotesViewModel {
|
|||
this.error = ''
|
||||
}
|
||||
|
||||
private _xIdle(err: string = '') {
|
||||
private _xIdle(err?: any) {
|
||||
this.isLoading = false
|
||||
this.isRefreshing = false
|
||||
this.hasLoaded = true
|
||||
this.error = err
|
||||
this.error = err ? err.toString() : ''
|
||||
if (err) {
|
||||
this.rootStore.log.error('Failed to fetch votes', err)
|
||||
}
|
||||
}
|
||||
|
||||
// loader functions
|
||||
|
@ -124,7 +127,7 @@ export class VotesViewModel {
|
|||
this._replaceAll(res)
|
||||
this._xIdle()
|
||||
} catch (e: any) {
|
||||
this._xIdle(`Failed to load feed: ${e.toString()}`)
|
||||
this._xIdle(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue