#14052

refactor(config): return Result instead of throwing and hand-catching ConfigurationError in IdaConfiguration and KiloClientLocation

Openmorlutoopened 2d ago

Summary

scripts/verify/baselines/hand-caught-configuration-error.json currently tolerates hand-caught ConfigurationError sites in src/ida/IdaConfiguration.ts and src/application/SupportedClientLocations.ts:

  • readIdaConfiguration threw registrationTooLarge() inside withOwnedRegularFile only to immediately catch ConfigurationError and convert it back to err(cause).
  • kiloInlineConfiguration and kiloGlobalLocation threw ConfigurationError, forcing SupportedClientLocations.kiloLayeredLocation to catch ConfigurationError by hand.

Proposed Change

Return Result<..., ConfigurationError> directly from the withOwnedRegularFile callback in IdaConfiguration.ts and from kiloInlineConfiguration / kiloGlobalLocation in KiloClientLocation.ts, delete both hand-caught ConfigurationError branches, and lower scripts/verify/baselines/hand-caught-configuration-error.json.

Activity

0

No activity yet.