Skip to content

Commit

Permalink
Fix cln error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Impa10r committed Oct 6, 2024
1 parent ac098ae commit 60fad60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
/* {
"name": "Launch Package",
"type": "go",
"request": "launch",
Expand All @@ -15,7 +15,7 @@
"envFile": "${workspaceFolder}/.env",
//"args": ["-datadir", "/home/vlad/.peerswap_t4"]
//"args": ["-datadir", "/home/vlad/.peerswap3"]
},/*
}, */
// sudo bash -c 'echo 0 > /proc/sys/kernel/yama/ptrace_scope'
// go install -tags cln -gcflags 'all=-N -l' ./cmd/psweb
// lcli -k plugin subcommand=stop plugin=/home/vlad/go/bin/psweb
Expand Down
10 changes: 5 additions & 5 deletions cmd/psweb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@ func redirectWithError(w http.ResponseWriter, r *http.Request, redirectUrl strin
// translate common errors into plain English
switch {
case strings.HasPrefix(t, "rpc error: code = Unavailable desc = connection error"):
t = "Peerswapd has not started listening yet. Check log."
t = "Peerswapd has not started listening yet. Check logs."
redirectUrl = "/log?"
case strings.HasPrefix(t, "-1:peerswap is still in the process of starting up"):
t = "Peerswap is still in the process of starting up. Check log."
redirectUrl = "/log?log=cln.log"
t = "Peerswap is still in the process of starting up. Check logs."
redirectUrl = "/log?log=cln.log&"
case strings.HasPrefix(t, "Unable to dial socket"):
t = "Lightningd has not started listening yet. Check log."
redirectUrl = "/log?log=cln.log"
t = "Lightningd has not started listening yet. Check logs."
redirectUrl = "/log?log=cln.log&"
case strings.HasPrefix(t, "rpc error: code = "):
i := strings.Index(t, "desc =")
if i > 0 {
Expand Down

0 comments on commit 60fad60

Please sign in to comment.