Skip to content

Commit

Permalink
Fix unregister container result handling in PiContainerApi
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Dec 19, 2024
1 parent 17d2f2f commit 34a224c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/api/impl/privacy_idea_container_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ class PiContainerApi implements TokenContainerApi {
try {
challenge = await _getChallenge(container, unregisterUrl);
} on PiServerResultError catch (e) {
if (e.code == 3001) {
return UnregisterContainerResult(success: false);
if (e.code == 3001 || e.code == 601) {
return UnregisterContainerResult(success: true);
}
rethrow;
}
Expand All @@ -251,9 +251,6 @@ class PiContainerApi implements TokenContainerApi {
final piResponse = response.asPiServerResponse<UnregisterContainerResult>();
final errorResponse = piResponse?.asError;
if (errorResponse != null) {
if (errorResponse.piServerResultError.code == 3002) {
return UnregisterContainerResult(success: true);
}
throw errorResponse.piServerResultError;
}
if (response.statusCode != 200 || piResponse == null) throw ResponseError(response);
Expand Down

0 comments on commit 34a224c

Please sign in to comment.