-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr-network-import-disallowed.ts
88 lines (82 loc) · 2.29 KB
/
err-network-import-disallowed.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* @file Errors - ERR_NETWORK_IMPORT_DISALLOWED
* @module errnode/errors/ERR_NETWORK_IMPORT_DISALLOWED
* @see https://github.com/nodejs/node/blob/v19.3.0/lib/internal/errors.js#L1485-L1486
*/
import E from '#e'
import { codes } from '#src/enums'
import type {
NodeError,
NodeErrorConstructor,
Stringifiable
} from '#src/interfaces'
/**
* `ERR_NETWORK_IMPORT_DISALLOWED` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_network_import_disallowed
*
* @extends {NodeError<codes.ERR_NETWORK_IMPORT_DISALLOWED>}
*/
interface ErrNetworkImportDisallowed
extends NodeError<codes.ERR_NETWORK_IMPORT_DISALLOWED> {}
/**
* `ERR_NETWORK_IMPORT_DISALLOWED` message arguments.
*
* @see {@linkcode Stringifiable}
*/
type Args = [specifier: Stringifiable, base: Stringifiable, reason: string]
/**
* `ERR_NETWORK_IMPORT_DISALLOWED` constructor.
*
* @see {@linkcode Args}
* @see {@linkcode ErrNetworkImportDisallowed}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrNetworkImportDisallowed,Args>}
*/
interface ErrNetworkImportDisallowedConstructor
extends NodeErrorConstructor<ErrNetworkImportDisallowed, Args> {
/**
* Create a new `ERR_NETWORK_IMPORT_DISALLOWED` error.
*
* @see {@linkcode ErrNetworkImportDisallowed}
* @see {@linkcode Stringifiable}
*
* @param {Stringifiable} specifier
* The invalid module specifier
* @param {Stringifiable} base
* Parent module id
* @param {string} reason
* Reason for error
* @return {ErrNetworkImportDisallowed}
*/
new (
specifier: Stringifiable,
base: Stringifiable,
reason: string
): ErrNetworkImportDisallowed
}
/**
* `ERR_NETWORK_IMPORT_DISALLOWED` model.
*
* Thrown when a network module attempts to load another module that it is not
* allowed to load.
*
* @see {@linkcode ErrNetworkImportDisallowedConstructor}
*
* @type {ErrNetworkImportDisallowedConstructor}
*
* @class
*/
const ERR_NETWORK_IMPORT_DISALLOWED: ErrNetworkImportDisallowedConstructor = E(
codes.ERR_NETWORK_IMPORT_DISALLOWED,
Error,
'import of \'%s\' by %s is not supported: %s'
)
export {
ERR_NETWORK_IMPORT_DISALLOWED as default,
type ErrNetworkImportDisallowed,
type Args as ErrNetworkImportDisallowedArgs,
type ErrNetworkImportDisallowedConstructor
}