This fixes an issue where an error coming from loading a project file is shown as a PklBugException.
There were two problems here:
proxyAddress needs to be a lazy value, because it can try to load a PklProject
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>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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:
main← Head:fix-project-loading📝 Commits (1)
1e2a9efCatch 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:
proxyAddressneeds to be a lazy value, because it can try to load a PklProjectproxyAddresscan throw aPklException, 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.