Skip to content

Commit

Permalink
Core: do not swallow examples errors (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti authored Dec 7, 2023
1 parent 19a353e commit 8abf24f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-poems-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/docgen": patch
---

Core: do not swallow examples errors
2 changes: 1 addition & 1 deletion docs/modules/Core.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Added in v1.0.0
**Signature**

```ts
export declare const main: Effect.Effect<never, never, void>
export declare const main: Effect.Effect<never, Error, void>
```
Added in v1.0.0
8 changes: 2 additions & 6 deletions src/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { Path } from "@effect/platform-node"
import chalk from "chalk"
import { Console, Effect, Layer, Logger, LogLevel, ReadonlyArray, String } from "effect"
import { Effect, Layer, Logger, LogLevel, ReadonlyArray, String } from "effect"
import * as ChildProcess from "./CommandExecutor.js"
import * as Config from "./Config.js"
import type * as Domain from "./Domain.js"
Expand Down Expand Up @@ -438,12 +438,8 @@ const MainLayer = Config.ConfigLive.pipe(Layer.provideMerge(Layer.mergeAll(
Process.ProcessLive
)))

const runnable = program.pipe(Effect.provide(MainLayer))

/**
* @category main
* @since 1.0.0
*/
export const main: Effect.Effect<never, never, void> = runnable.pipe(
Effect.catchAll((error) => Console.error(chalk.bold.red("Error:"), error.message))
)
export const main: Effect.Effect<never, Error, void> = program.pipe(Effect.provide(MainLayer))

0 comments on commit 8abf24f

Please sign in to comment.