about summary refs log tree commit diff stats
path: root/src/display
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-06-09 15:27:29 +0200
committerbptato <nincsnevem662@gmail.com>2023-06-09 15:27:29 +0200
commite8fa2217df7bacc58e88737f21752bbdf0f5562a (patch)
tree8fbec22f273f2cab5811b2f9b1dd5ea05496ef1a /src/display
parentb39e35e46773258cb103397b2372612308c22ae0 (diff)
downloadchawan-e8fa2217df7bacc58e88737f21752bbdf0f5562a.tar.gz
Show error messages, fix some fetch crashes
Diffstat (limited to 'src/display')
-rw-r--r--src/display/pager.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/display/pager.nim b/src/display/pager.nim
index 0dab3bf0..6db13fac 100644
--- a/src/display/pager.nim
+++ b/src/display/pager.nim
@@ -15,6 +15,7 @@ import config/config
 import data/charset
 import display/term
 import io/lineedit
+import io/loader
 import io/promise
 import io/request
 import io/window
@@ -790,7 +791,9 @@ proc handleEvent0(pager: Pager, container: Container, event: ContainerEvent): bo
     if container.retry.len > 0:
       pager.gotoURL(newRequest(container.retry.pop()), ctype = container.contenttype)
     else:
-      pager.alert("Can't load " & $container.source.location & " (error code " & $container.code & ")")
+      let errorMessage = getLoaderErrorMessage(container.code)
+      pager.alert("Can't load " & $container.source.location & " (" &
+        errorMessage & ")")
     return false
   of SUCCESS:
     if container.replace != nil: