Skip to content

Commit becf4a7

Browse files
committed
fix: library errors extend ErrorQUIC
1 parent 4797b17 commit becf4a7

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
# prettierrc for local editing
133+
.prettierrc

src/errors.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import type { POJO } from '@matrixai/errors';
1+
import type { POJO } from './types.js';
22
import type { ConnectionError, CryptoError } from './native/types.js';
33
import { AbstractError } from '@matrixai/errors';
44

55
class ErrorQUIC<T> extends AbstractError<T> {
66
static description = 'QUIC error';
77
}
88

9-
class ErrorQUICUndefinedBehaviour<T> extends AbstractError<T> {
9+
class ErrorQUICUndefinedBehaviour<T> extends ErrorQUIC<T> {
1010
static description = 'You should never see this error';
1111
}
1212

13-
class ErrorQUICHostInvalid<T> extends AbstractError<T> {
13+
class ErrorQUICHostInvalid<T> extends ErrorQUIC<T> {
1414
static description = 'Host provided was not valid';
1515
}
1616

17-
class ErrorQUICPortInvalid<T> extends AbstractError<T> {
17+
class ErrorQUICPortInvalid<T> extends ErrorQUIC<T> {
1818
static description = 'Port provided was not valid';
1919
}
2020

src/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type QUICStream from './QUICStream.js';
22
import type { CryptoError } from './native/types.js';
33

4+
type POJO = { [key: string]: any };
5+
46
/**
57
* Opaque types are wrappers of existing types
68
* that require smart constructors
@@ -350,6 +352,7 @@ type StreamCodeToReason = (type: 'read' | 'write', code: number) => any;
350352
type QUICStreamMap = Map<StreamId, QUICStream>;
351353

352354
export type {
355+
POJO,
353356
Opaque,
354357
Class,
355358
Callback,

0 commit comments

Comments
 (0)