-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr-invalid-file-url-host.ts
82 lines (76 loc) · 2.12 KB
/
err-invalid-file-url-host.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
/**
* @file Errors - ERR_INVALID_FILE_URL_HOST
* @module errnode/errors/ERR_INVALID_FILE_URL_HOST
* @see https://github.com/nodejs/node/blob/v22.8.0/lib/internal/errors.js#L1470-L1471
*/
import E from '#e'
import { codes } from '#src/enums'
import type {
NodeError,
NodeErrorConstructor,
Stringifiable
} from '#src/interfaces'
/**
* `ERR_INVALID_FILE_URL_HOST` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_invalid_file_url_host
*
* @extends {NodeError<codes.ERR_INVALID_FILE_URL_HOST>}
* @extends {TypeError}
*/
interface ErrInvalidFileUrlHost
extends NodeError<codes.ERR_INVALID_FILE_URL_HOST>, TypeError {}
/**
* `ERR_INVALID_FILE_URL_HOST` message arguments.
*
* @see {@linkcode Stringifiable}
*/
type Args = [platform: Stringifiable]
/**
* `ERR_INVALID_FILE_URL_HOST` constructor.
*
* @see {@linkcode ErrInvalidFileUrlHost}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrInvalidFileUrlHost,Args>}
*/
interface ErrInvalidFileUrlHostConstructor
extends NodeErrorConstructor<ErrInvalidFileUrlHost, Args> {
/**
* Create a new `ERR_INVALID_FILE_URL_HOST` error.
*
* @see {@linkcode ErrInvalidFileUrlHost}
* @see {@linkcode Stringifiable}
*
* @param {Stringifiable} platform
* Platform invalid host was encountered on
* @return {ErrInvalidFileUrlHost}
*/
new (platform: Stringifiable): ErrInvalidFileUrlHost
}
/**
* `ERR_INVALID_FILE_URL_HOST` model.
*
* Thrown when a Node.js API that consumes `file:` URLs encountered a file URL
* with an incompatible host.
* This situation can only occur on Unix-like systems where only `localhost` or
* an empty host is supported.
*
* @see {@linkcode ErrInvalidFileUrlHostConstructor}
*
* @type {ErrInvalidFileUrlHostConstructor}
*
* @class
*/
const ERR_INVALID_FILE_URL_HOST: ErrInvalidFileUrlHostConstructor = E(
codes.ERR_INVALID_FILE_URL_HOST,
TypeError,
'File URL host must be "localhost" or empty on %s'
)
export {
ERR_INVALID_FILE_URL_HOST as default,
type ErrInvalidFileUrlHost,
type Args as ErrInvalidFileUrlHostArgs,
type ErrInvalidFileUrlHostConstructor
}