Skip to content

Commit c77dc1a

Browse files
universal-hex: Update error wording to be more precise.
1 parent 314ee79 commit c77dc1a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/__tests__/universal-hex.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,16 +1159,16 @@ describe('Test createUniversalHex()', () => {
11591159
};
11601160

11611161
expect(failFirstBlocks).toThrow(
1162-
'EoF record found at line 10 of 14 in Board ID 39168'
1162+
'EoF record found at record 10 of 14 in Board ID 39168 hex'
11631163
);
11641164
expect(failFirstSections).toThrow(
1165-
'EoF record found at line 10 of 14 in Board ID 39168'
1165+
'EoF record found at record 10 of 14 in Board ID 39168 hex'
11661166
);
11671167
expect(failSecondBlocks).toThrow(
1168-
'EoF record found at line 12 of 14 in Board ID 39171'
1168+
'EoF record found at record 12 of 14 in Board ID 39171 hex'
11691169
);
11701170
expect(failSecondSections).toThrow(
1171-
'EoF record found at line 12 of 14 in Board ID 39171'
1171+
'EoF record found at record 12 of 14 in Board ID 39171 hex'
11721172
);
11731173
});
11741174
});

src/universal-hex.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function iHexToCustomFormatBlocks(iHexStr: string, boardId: number): string {
9292
// Error if we encounter an EoF record and it's not the end of the file
9393
if (ih !== hexRecords.length) {
9494
throw new Error(
95-
`EoF record found at line ${ih} of ${hexRecords.length} in Board ID ${boardId}`
95+
`EoF record found at record ${ih} of ${hexRecords.length} in Board ID ${boardId} hex`
9696
);
9797
}
9898
// The EoF record goes after the Block End Record, it won't break 512-byte
@@ -188,7 +188,7 @@ function iHexToCustomFormatSection(iHexStr: string, boardId: number): string {
188188
}
189189
if (ih !== hexRecords.length) {
190190
throw new Error(
191-
`EoF record found at line ${ih} of ${hexRecords.length} in Board ID ${boardId}`
191+
`EoF record found at record ${ih} of ${hexRecords.length} in Board ID ${boardId} hex `
192192
);
193193
}
194194

0 commit comments

Comments
 (0)