aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-05-24 03:28:14 -0700
committerFuwn <[email protected]>2025-05-24 03:28:14 -0700
commit388181c0250f1eb1e1c782ed07f2da4b927e9124 (patch)
treec350f2ba73e5c7f53bfede86a97cd36241c3cf5b
parent11675972de7e3cf10d11470fc736ec78aa00ee18 (diff)
downloadgigi-388181c0250f1eb1e1c782ed07f2da4b927e9124.tar.xz
gigi-388181c0250f1eb1e1c782ed07f2da4b927e9124.zip
feat(gigi.go): Emit connection write errors
-rw-r--r--gigi.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/gigi.go b/gigi.go
index e127b7d..3b2d81a 100644
--- a/gigi.go
+++ b/gigi.go
@@ -86,8 +86,11 @@ func handleConnection(connection net.Conn, mode int) {
return
}
- connection.Write([]byte(fileContent))
- log.Printf("info: success: %s", bufferContent)
+ if _, connectionWriteError := connection.Write([]byte(fileContent)); connectionWriteError != nil {
+ log.Printf("warn: could not write to connection: %s", connectionWriteError.Error())
+ } else {
+ log.Printf("info: success: %s", bufferContent)
+ }
}
func readFile(filename string) (string, error) {