mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
lib: throw a special error in internal/assert
Instead of using the public AssertionError, use a simplified error that describes potential causes of these assertions and suggests the user to open an issue. PR-URL: https://github.com/nodejs/node/pull/26635 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
1 parent
237d9f9716
commit
b9f1e57201
12 files changed
+100
-28
No files matched your search
@@ -78,12 +78,9 @@ common.expectsError(
|
||||
assert.throws(() => tls.createServer({ ticketKeys: Buffer.alloc(0) }),
|
||||
/TypeError: Ticket keys length must be 48 bytes/);
|
||||
|
||||
common.expectsError(
|
||||
common.expectsInternalAssertion(
|
||||
() => tls.createSecurePair({}),
|
||||
{
|
||||
code: 'ERR_ASSERTION',
|
||||
message: 'context.context must be a NativeSecureContext'
|
||||
}
|
||||
'context.context must be a NativeSecureContext'
|
||||
);
|
||||
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user