Updated fetch input error message

This commit is contained in:
Ceferino Patino 2024-12-11 22:59:06 -06:00
commit 40e7ec808d
Signed by: c4patino
SSH key fingerprint: SHA256:Wu+cU1t+7zVT9wzew/4meNmeulo66NzMqc22MdDBgXI

View file

@ -9,8 +9,6 @@ import (
"os"
)
// https://adventofcode.com/2024/day/{day}/answer
func retrieveInput(day int) error {
cookieValue := os.Getenv("COOKIE")
if cookieValue == "" {
@ -47,7 +45,7 @@ func retrieveInput(day int) error {
}
if resp.StatusCode != http.StatusOK {
return errors.New(fmt.Sprintf("Unexpected status code: %d\nBody: %s", resp.StatusCode, string(body)))
return errors.New(fmt.Sprintf("Unexpected status code: %d\n%s", resp.StatusCode, string(body)))
}
filename := fmt.Sprintf("./day%02d/input.txt", day)