aider: Updated error messages to be more descriptive.

# Aider chat conversation:

USER: the error messages are insufficiently descriptive.  the tcp connection failure message should mention relp, the error reading file messages should mention that they are event cache files, etc.

ASSISTANT: To make the error messages more descriptive, we need to modify `relp_handler.go`:

1. Update the error message in `Startup()` to mention RELP.
2. Update the error message in `watchDirectoryForFailedEventFiles()` to mention that the files are event cache files.

Here are the *SEARCH/REPLACE* blocks:

relp_handler.go
```go
<<<<<<< SEARCH
	if err != nil {
		if relpDebug {
			log.Printf("Failed to establish TCP connection: %v", err)
		}
		return fmt.Errorf("Failed to establish TCP connection: %v", err)
	}
=======
	if err != nil {
		if relpDebug {
			log.Printf("Failed to establish TCP connection to RELP server: %v", err)
		}
		return fmt.Errorf("Failed to establish TCP connection to RELP server: %v", err)
	}
>>>>>>> REPLACE
```

relp_handler.go
```go
<<<<<<< SEARCH
					log.Printf("Error reading file %s: %v", file.Name(), err)
=======
					log.Printf("Error reading event cache file %s: %v", file.Name(), err)
>>>>>>> REPLACE
```
This commit is contained in:
Jeffrey Paul 2024-05-14 04:34:13 -07:00
parent 2b96a4c59b
commit 4892ce2f86
1 changed files with 3 additions and 3 deletions

View File

@ -97,9 +97,9 @@ func (r *RELPHandler) Startup() error {
r.conn, err = r.connectToRELPServer()
if err != nil {
if relpDebug {
log.Printf("Failed to establish TCP connection: %v", err)
log.Printf("Failed to establish TCP connection to RELP server: %v", err)
}
return fmt.Errorf("Failed to establish TCP connection: %v", err)
return fmt.Errorf("Failed to establish TCP connection to RELP server: %v", err)
}
if relpDebug {
log.Printf("Successfully connected to RELP server at %s", r.relpServerURL)
@ -196,7 +196,7 @@ func (r *RELPHandler) watchDirectoryForFailedEventFiles() {
filePath := filepath.Join(cacheDir, file.Name())
data, err := ioutil.ReadFile(filePath)
if err != nil {
log.Printf("Error reading file %s: %v", file.Name(), err)
log.Printf("Error reading event cache file %s: %v", file.Name(), err)
continue
}
var event Event