Simply error surfacing

This commit is contained in:
Theodor S. Midtlien
2026-09-25 11:14:34 +02:00
parent ec3a20e979
commit 1939f44bcd
22 changed files with 332 additions and 47 deletions
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "Dieses Profil gehört einem anderen Benutzer."
},
"error.profile_unowned": {
"message": "Dieses Profil hat noch keinen Besitzer."
}
}
+4
View File
@@ -1870,5 +1870,9 @@
"error.not_profile_owner": {
"message": "This profile belongs to another user.",
"description": "Short headline when the daemon refuses an action because the profile it addresses is owned by a different user account."
},
"error.profile_unowned": {
"message": "This profile has no owner yet.",
"description": "Short headline when the daemon refuses an action because the profile it addresses has no owner recorded yet. The daemon's own sentence is shown as the detail, followed by a copyable command that records an owner."
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "Este perfil pertenece a otro usuario."
},
"error.profile_unowned": {
"message": "Este perfil aún no tiene propietario."
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "Ce profil appartient à un autre utilisateur."
},
"error.profile_unowned": {
"message": "Ce profil n'a pas encore de propriétaire."
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "Ez a profil egy másik felhasználóé."
},
"error.profile_unowned": {
"message": "Ennek a profilnak még nincs tulajdonosa."
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "Questo profilo appartiene a un altro utente."
},
"error.profile_unowned": {
"message": "Questo profilo non ha ancora un proprietario."
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "このプロファイルは別のユーザーのものです。"
},
"error.profile_unowned": {
"message": "このプロファイルにはまだ所有者がいません。"
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "Este perfil pertence a outro usuário."
},
"error.profile_unowned": {
"message": "Este perfil ainda não tem proprietário."
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "Этот профиль принадлежит другому пользователю."
},
"error.profile_unowned": {
"message": "У этого профиля пока нет владельца."
}
}
+3
View File
@@ -1402,5 +1402,8 @@
},
"error.not_profile_owner": {
"message": "Цей профіль належить іншому користувачеві."
},
"error.profile_unowned": {
"message": "Цей профіль ще не має власника."
}
}
+3
View File
@@ -1404,5 +1404,8 @@
},
"error.not_profile_owner": {
"message": "此配置文件属于其他用户。"
},
"error.profile_unowned": {
"message": "此配置文件尚未设置所有者。"
}
}
+2
View File
@@ -26,6 +26,8 @@ func denialCode(reason string) (string, bool) {
return "session_held", true
case ipcauth.ErrorReasonNotProfileOwner:
return "not_profile_owner", true
case ipcauth.ErrorReasonProfileUnowned:
return "profile_unowned", true
default:
return "permission_denied", false
}
+7
View File
@@ -70,6 +70,7 @@ func TestClassifyMapsEveryDaemonReason(t *testing.T) {
{"privilege", ipcauth.PrivilegeError("Claiming a profile requires root.", "sudo netbird profile claim"), "privilege_required", true},
{"session held", ipcauth.SessionHeldError("switching profile"), "session_held", true},
{"not owner", ipcauth.NotOwnerError("reading the profile configuration"), "not_profile_owner", false},
{"unowned", ipcauth.UnownedError("connecting", "default", false), "profile_unowned", true},
} {
t.Run(tc.name, func(t *testing.T) {
got := c.classify(tc.err)
@@ -116,6 +117,12 @@ func TestDenialHeadlinesResolveInTheShippedBundle(t *testing.T) {
"This profile belongs to another user.",
"Reading the profile configuration is refused because the profile it addresses belongs to another user.",
},
{
"unowned",
ipcauth.UnownedError("connecting", "default", false),
"This profile has no owner yet.",
"Connecting is refused because the profile it addresses has no owner on record.",
},
} {
t.Run(tc.name, func(t *testing.T) {
got := c.classify(tc.err)