about summary refs log tree commit diff
path: root/src/state/models/post.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models/post.ts')
-rw-r--r--src/state/models/post.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/state/models/post.ts b/src/state/models/post.ts
index 1c49e32f2..497c8e4c9 100644
--- a/src/state/models/post.ts
+++ b/src/state/models/post.ts
@@ -63,10 +63,14 @@ export class PostModel implements RemoveIndex<Post.Record> {
     this.error = ''
   }
 
-  private _xIdle(err: string = '') {
+  private _xIdle(err?: any) {
     this.isLoading = false
     this.hasLoaded = true
     this.error = cleanError(err)
+    this.error = err ? cleanError(err) : ''
+    if (err) {
+      this.rootStore.log.error('Failed to fetch post', err)
+    }
   }
 
   // loader functions
@@ -87,7 +91,7 @@ export class PostModel implements RemoveIndex<Post.Record> {
       this._replaceAll(res.value)
       this._xIdle()
     } catch (e: any) {
-      this._xIdle(e.toString())
+      this._xIdle(e)
     }
   }