[PR #943] [MERGED] Remove private key constant errors from NewHeadscale #1755

Closed
opened 2025-12-29 02:31:34 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/943
Author: @GrigoriyMikhalkin
Created: 11/9/2022
Status: Merged
Merged: 11/10/2022
Merged by: @kradalby

Base: mainHead: nois-priv-key-err


📝 Commits (1)

  • 85f7866 remove private key constant errors from NewHeadscale

📊 Changes

1 file changed (+3 additions, -9 deletions)

View changed files

📝 app.go (+3 -9)

📄 Description

In NewHeadscale function exported constant errors are used in case of private key problems. They overshadow lower level errors that happen during reading/creation of private keys.

It's probably safe to assume that function NewHeadscale is not used in other packages. So missing constant errors shouldn't be a big problem for a users(otherwise it can be fixed with a little bit hacky error's Is implementation on the user side). On the other hand, overshadowing lower level errors can be a problem for debugging when running Headscale server(which will be more common problem).


🔄 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/juanfont/headscale/pull/943 **Author:** [@GrigoriyMikhalkin](https://github.com/GrigoriyMikhalkin) **Created:** 11/9/2022 **Status:** ✅ Merged **Merged:** 11/10/2022 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `nois-priv-key-err` --- ### 📝 Commits (1) - [`85f7866`](https://github.com/juanfont/headscale/commit/85f7866112a496efec7f1ac95380bf4367d39620) remove private key constant errors from NewHeadscale ### 📊 Changes **1 file changed** (+3 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `app.go` (+3 -9) </details> ### 📄 Description In [NewHeadscale](https://github.com/juanfont/headscale/blob/main/app.go#L131) function exported constant errors are used in case of private key problems. They overshadow lower level errors that happen during reading/creation of private keys. It's probably safe to assume that function `NewHeadscale` is not used in other packages. So missing constant errors shouldn't be a big problem for a users(otherwise it can be fixed with a little bit hacky error's `Is` implementation on the user side). On the other hand, overshadowing lower level errors can be a problem for debugging when running Headscale server(which will be more common problem). --- <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-29 02:31:34 +01:00
adam closed this issue 2025-12-29 02:31:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1755