Skip to content

Commit 7d14771

Browse files
fix(serverSettings): map SchemaError to ServerSettingsError in layerTest
1 parent d3d6783 commit 7d14771

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎apps/server/src/serverSettings.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,20 @@ export class ServerSettingsService extends Context.Service<
7979
start: Effect.void,
8080
ready: Effect.void,
8181
getSettings: Ref.get(currentSettingsRef),
82-
updateSettings: (patch) =>
82+
updateSettings: (patch) =>
8383
Ref.get(currentSettingsRef).pipe(
8484
Effect.flatMap((currentSettings) =>
8585
Schema.decodeEffect(ServerSettings)(
8686
applyServerSettingsPatch(currentSettings, patch),
87+
).pipe(
88+
Effect.mapError(
89+
(cause) =>
90+
new ServerSettingsError({
91+
settingsPath: "<memory>",
92+
detail: `failed to normalize server settings: ${SchemaIssue.makeFormatterDefault()(cause.issue)}`,
93+
cause,
94+
}),
95+
),
8796
),
8897
),
8998
Effect.tap((nextSettings) => Ref.set(currentSettingsRef, nextSettings)),

0 commit comments

Comments
 (0)