kitchen sink peer connect and channel create

This commit is contained in:
Paul Miller
2023-04-11 10:10:18 -05:00
parent 9173701c13
commit f5b48c28b2
4 changed files with 226 additions and 16 deletions

10
src/utils/eify.ts Normal file
View File

@@ -0,0 +1,10 @@
/// Sometimes we catch an error as `unknown` so this turns it into an Error.
export default function eify(e: unknown): Error {
if (e instanceof Error) {
return e;
} else if (typeof e === 'string') {
return new Error(e);
} else {
return new Error('Unknown error');
}
}