© 2026 Hedgehog Software, LLC
import { Effect, pipe } from 'effect' import { type Asset } from './schema' const assets: Asset[] = [{ id: 1, name: 'Truck 1' }] class DBError { readonly _tag = 'DBError' readonly message: string constructor (message: string) { this.message = message } } const getSubscribedAssets = pipe( Effect.tryPromise({ try: async () => await Promise.resolve(assets), catch: () => new DBError('cannot get subscribed assets') }), Effect.catchTags({ DBError: (e) => pipe( Effect.logInfo(e.message) ) }) )
getSubscribedAssets
Effect.Effect<never, never, void | Asset[]>
void