Skip to content

Commit

Permalink
Add better error messaging when structure is missing, #99
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jul 28, 2024
1 parent 7e113c2 commit 98926d0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ export function read() {
}
const validName = /^[a-zA-Z_$][a-zA-Z\d_$]*$/
function createStructureReader(structure) {
if (!structure) throw new Error('Structure is required in record definition');
function readObject() {
// get the array size from the header
let length = src[position++]
Expand Down

0 comments on commit 98926d0

Please sign in to comment.