Effect.gen(function* () {
yield * Effect.tryPromise({
try: async () => await tryUseNuxtApp()?.runWithContext(() => console.log('first in context')), // logs
catch: error => new UnknownApplicationError({ error }, `Unexpected error while executing in Nuxt context. ${(error as Error).message}`),
})
yield * Effect.tryPromise({
try: async () => await tryUseNuxtApp()?.runWithContext(() => console.log('second in context')), // doesnt log
catch: error => new UnknownApplicationError({ error }, `Unexpected error while executing in Nuxt context. ${(error as Error).message}`),
})
})
Effect.gen(function* () {
yield * Effect.tryPromise({
try: async () => await tryUseNuxtApp()?.runWithContext(() => console.log('first in context')), // logs
catch: error => new UnknownApplicationError({ error }, `Unexpected error while executing in Nuxt context. ${(error as Error).message}`),
})
yield * Effect.tryPromise({
try: async () => await tryUseNuxtApp()?.runWithContext(() => console.log('second in context')), // doesnt log
catch: error => new UnknownApplicationError({ error }, `Unexpected error while executing in Nuxt context. ${(error as Error).message}`),
})
})