Skip to content

Commit

Permalink
Warn about fixed length Photon arrays instead of throwing
Browse files Browse the repository at this point in the history
Fixed length arrays are supported by non-Photon structs, which still need to be compiled by PhotonStructDecoder. This isn't an actual issue unless a Photon struct tries to use a struct with an unsupported array. Returning false just indicates that the schema cannot be compiled or used in parent schemas.
  • Loading branch information
jwbonner committed Nov 16, 2024
1 parent d59c28d commit ef2c7d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/shared/log/PhotonStructDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ export default class PhotonStructDecoder {
if (arrayLengthStr === "?") {
isArray = true; // VLA
} else {
throw new Error("Fixed length arrays are unimplemented");
console.warn("Fixed length arrays are unimplemented");
return false;
}
} else {
// Normal value
name = nameStr;
}

if (isOptional && isArray) {
throw Error("Can't be optional AND array?");
console.warn("Can't be optional AND array?");
return false;
}

// Create schema
Expand Down

0 comments on commit ef2c7d3

Please sign in to comment.