@bare-ts/lib
Version:
TypeScript library for BARE, a compact and simple binary-serialization format
19 lines (18 loc) • 450 B
JavaScript
//! Copyright (c) 2022 Victorien Elvinger
//! Licensed under the MIT License (https://mit-license.org/)
/**
* @sealed
*/
export class BareError extends Error {
name = "BareError";
issue;
/**
* Byte offset in the read buffer where the error occurred.
*/
offset;
constructor(offset, issue, options) {
super(`(byte:${offset}) ${issue}`, options);
this.issue = issue;
this.offset = offset;
}
}