mirror of
https://github.com/jwetzell/psn-go.git
synced 2026-08-30 03:19:14 +00:00
return errors not log
This commit is contained in:
@@ -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,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,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,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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user