Skip to content

Commit ba6eca7

Browse files
authored
Fix yast2 extension registration error dialog (#361)
Correctly check for the new connection.ApiError When checking to see if an APIError has occurred we need to check for an error being an instance of the new version of the error object, as found in the pkg/connection package, rather than the old version defined in internal/connect. This ensures that when this type of error occurs then it is correctly detected as an APIError and reported as such to the Ruby bindinsg that call libsuseconnect. Update package .changes file. Co-Authored-By: esampson@suse.com
1 parent 84c11a9 commit ba6eca7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

build/packaging/suseconnect-ng.changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Thu Mar 12 18:53:13 UTC 2026 - Felix Schnizlein <fschnizlein@suse.com>
1111
(jsc#TEL-260).
1212
- Removed backport patch: fix-libsuseconnect-and-pci.patch
1313
- Add missing product id to allow yast2-registration to not break (bsc#1257825)
14+
- Fix libsuseconnect APIError detection logic (bsc#1257825)
1415

1516
-------------------------------------------------------------------
1617
Wed Mar 4 16:48:14 UTC 2026 - Felix Schnizlein <fschnizlein@suse.com>

third_party/libsuseconnect/libsuseconnect.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/SUSE/connect-ng/internal/connect"
2222
cred "github.com/SUSE/connect-ng/internal/credentials"
2323
"github.com/SUSE/connect-ng/internal/util"
24+
"github.com/SUSE/connect-ng/pkg/connection"
2425
"github.com/SUSE/connect-ng/pkg/registration"
2526
"github.com/SUSE/connect-ng/pkg/search"
2627
)
@@ -303,7 +304,7 @@ func errorToJSON(err error) string {
303304
// TODO: add other values as needed
304305
}
305306

306-
if ae, ok := err.(connect.APIError); ok {
307+
if ae, ok := err.(*connection.ApiError); ok {
307308
s.ErrType = "APIError"
308309
s.Code = ae.Code
309310
s.Message = ae.Message

0 commit comments

Comments
 (0)