mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 08:45:38 +02:00
✨ feat: Host a relay on Hetzner (#114)
We are hosting a [MoQ](https://quic.video) relay on a remote (bare metal) server on Hetzner With a lot of help from @victorpahuus
This commit is contained in:
14
packages/moq/common/error.ts
Normal file
14
packages/moq/common/error.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
// I hate javascript
|
||||
export function asError(e: any): Error {
|
||||
if (e instanceof Error) {
|
||||
return e
|
||||
} else if (typeof e === "string") {
|
||||
return new Error(e)
|
||||
} else {
|
||||
return new Error(String(e))
|
||||
}
|
||||
}
|
||||
|
||||
export function isError(e: any): e is Error {
|
||||
return e instanceof Error
|
||||
}
|
||||
Reference in New Issue
Block a user