[PR #527] [MERGED] Catch PklException errors coming from project load #603

Closed
opened 2025-12-30 01:25:36 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/527
Author: @bioball
Created: 6/13/2024
Status: Merged
Merged: 6/14/2024
Merged by: @bioball

Base: mainHead: fix-project-loading


📝 Commits (1)

  • 1e2a9ef Catch PklException errors coming from project load

📊 Changes

1 file changed (+5 additions, -4 deletions)

View changed files

📝 pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliCommand.kt (+5 -4)

📄 Description

This fixes an issue where an error coming from loading a project file is shown as a PklBugException.

There were two problems here:

  1. proxyAddress needs to be a lazy value, because it can try to load a PklProject
  2. accessing proxyAddress can throw a PklException, so it needs to be within the try/catch

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/527 **Author:** [@bioball](https://github.com/bioball) **Created:** 6/13/2024 **Status:** ✅ Merged **Merged:** 6/14/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `fix-project-loading` --- ### 📝 Commits (1) - [`1e2a9ef`](https://github.com/apple/pkl/commit/1e2a9efb8cc1c90d1074218bd4066482cd91dd9b) Catch PklException errors coming from project load ### 📊 Changes **1 file changed** (+5 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/CliCommand.kt` (+5 -4) </details> ### 📄 Description This fixes an issue where an error coming from loading a project file is shown as a PklBugException. There were two problems here: 1. `proxyAddress` needs to be a lazy value, because it can try to load a PklProject 2. accessing `proxyAddress` can throw a `PklException`, so it needs to be within the try/catch --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:25:36 +01:00
adam closed this issue 2025-12-30 01:25:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#603