mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
0deb27bd29
Add test that confirms that when libuv reports a memory error on a DNS query, that the memory error is passed through and not replaced with ENOTFOUND. PR-URL: https://github.com/nodejs/node/pull/20317 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
16 lines
455 B
JavaScript
16 lines
455 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
// Check that if libuv reports a memory error on a DNS query, that the memory
|
|
// error is passed through and not replaced with ENOTFOUND.
|
|
|
|
require('../common');
|
|
|
|
const assert = require('assert');
|
|
const errors = require('internal/errors');
|
|
|
|
const { UV_EAI_MEMORY } = process.binding('uv');
|
|
const memoryError = errors.dnsException(UV_EAI_MEMORY, 'fhqwhgads');
|
|
|
|
assert.strictEqual(memoryError.code, 'EAI_MEMORY');
|