Skip to content

Commit

Permalink
better error
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Oct 6, 2023
1 parent 4bebc18 commit 5eaf57f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yarn-project/types/src/l2_block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ export class L2Block {
*/
encode(): Buffer {
if (this.newEncryptedLogs === undefined || this.newUnencryptedLogs === undefined) {
throw new Error('newEncryptedLogs and newUnencryptedLogs must be defined when encoding L2BlockData');
throw new Error(
`newEncryptedLogs and newUnencryptedLogs must be defined when encoding L2BlockData (block ${this.number})`,
);
}

return serializeToBuffer(
Expand Down

0 comments on commit 5eaf57f

Please sign in to comment.