-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherr-no-crypto.ts
69 lines (63 loc) · 1.48 KB
/
err-no-crypto.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
/**
* @file Errors - ERR_NO_CRYPTO
* @module errnode/errors/ERR_NO_CRYPTO
* @see https://github.com/nodejs/node/blob/v22.8.0/lib/internal/errors.js#L1603-L1604
*/
import E from '#e'
import { codes } from '#src/enums'
import type { NodeError, NodeErrorConstructor } from '#src/interfaces'
/**
* `ERR_NO_CRYPTO` schema.
*
* @see {@linkcode NodeError}
* @see https://nodejs.org/api/errors.html#err_no_crypto
*
* @extends {NodeError<codes.ERR_NO_CRYPTO>}
*/
interface ErrNoCrypto extends NodeError<codes.ERR_NO_CRYPTO> {}
/**
* `ERR_NO_CRYPTO` message arguments.
*/
type Args = []
/**
* `ERR_NO_CRYPTO` constructor.
*
* @see {@linkcode ErrNoCrypto}
* @see {@linkcode NodeErrorConstructor}
*
* @extends {NodeErrorConstructor<ErrNoCrypto,Args>}
*/
interface ErrNoCryptoConstructor
extends NodeErrorConstructor<ErrNoCrypto, Args> {
/**
* Create a new `ERR_NO_CRYPTO` error.
*
* @see {@linkcode ErrNoCrypto}
*
* @return {ErrNoCrypto}
*/
new (): ErrNoCrypto
}
/**
* `ERR_NO_CRYPTO` model.
*
* Thrown when an attempt was made to use crypto features while Node.js was not
* compiled with OpenSSL crypto support.
*
* @see {@linkcode ErrNoCryptoConstructor}
*
* @type {ErrNoCryptoConstructor}
*
* @class
*/
const ERR_NO_CRYPTO: ErrNoCryptoConstructor = E(
codes.ERR_NO_CRYPTO,
Error,
'Node.js is not compiled with OpenSSL crypto support'
)
export {
ERR_NO_CRYPTO as default,
type ErrNoCrypto,
type Args as ErrNoCryptoArgs,
type ErrNoCryptoConstructor
}