return errors not log

This commit is contained in:
Joel Wetzell
2026-08-28 10:06:05 -05:00
parent 237943431d
commit 57f7387820
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ package decoders
import (
"encoding/binary"
"log/slog"
"fmt"
"github.com/jwetzell/psn-go/internal/chunks"
)
@@ -43,7 +43,7 @@ func DecodeDataPacketChunk(bytes []byte) (chunks.DataPacketChunk, error) {
}
default:
slog.Error("unhandled info packet id", "id", id)
return chunks.DataPacketChunk{}, fmt.Errorf("unknown data packet ID: 0x%04x", id)
}
}
}
+2 -2
View File
@@ -2,7 +2,7 @@ package decoders
import (
"encoding/binary"
"log/slog"
"fmt"
"github.com/jwetzell/psn-go/internal/chunks"
)
@@ -93,7 +93,7 @@ func DecodeDataTrackerChunk(bytes []byte) (chunks.DataTrackerChunk, error) {
}
default:
offset = int(chunk.Header.DataLen)
slog.Error("unhandled data tracker packet chunk id", "id", id)
return chunks.DataTrackerChunk{}, fmt.Errorf("unknown data tracker chunk ID: 0x%04x", id)
}
}
}
+2 -2
View File
@@ -2,7 +2,7 @@ package decoders
import (
"encoding/binary"
"log/slog"
"fmt"
"github.com/jwetzell/psn-go/internal/chunks"
)
@@ -51,7 +51,7 @@ func DecodeInfoPacketChunk(bytes []byte) (chunks.InfoPacketChunk, error) {
}
default:
slog.Error("unhandled info packet id", "id", id)
return chunks.InfoPacketChunk{}, fmt.Errorf("unknown info packet ID: 0x%04x", id)
}
}
}
+2 -2
View File
@@ -2,7 +2,7 @@ package decoders
import (
"encoding/binary"
"log/slog"
"fmt"
"github.com/jwetzell/psn-go/internal/chunks"
)
@@ -30,7 +30,7 @@ func DecodeInfoTrackerChunk(bytes []byte) (chunks.InfoTrackerChunk, error) {
offset = offset + int(tracker_name.Chunk.Header.DataLen)
}
default:
slog.Error("unhandled info tracker chunk id", "id", id)
return chunks.InfoTrackerChunk{}, fmt.Errorf("unknown info tracker chunk ID: 0x%04x", id)
}
}
}