forked from aws-amplify/amplify-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(DataStore): dataStore cannot connect to model's sync subscription…
…s (AWS_LAMBDA auth type) aws-amplify#3549
- Loading branch information
Showing
8 changed files
with
348 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
Amplify/Categories/DataStore/Subscribe/DataStoreSubscriptionRTFError.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
|
||
public enum RTFError: CaseIterable { | ||
case unknownField | ||
case maxAttributes | ||
case maxCombinations | ||
case repeatedFieldname | ||
case notGroup | ||
case fieldNotInType | ||
|
||
private var uniqueMessagePart: String { | ||
switch self { | ||
case .unknownField: | ||
return "UnknownArgument: Unknown field argument filter" | ||
case .maxAttributes: | ||
return "Filters exceed maximum attributes limit" | ||
case .maxCombinations: | ||
return "Filters combination exceed maximum limit" | ||
case .repeatedFieldname: | ||
return "filter uses same fieldName multiple time" | ||
case .notGroup: | ||
return "The variables input contains a field name 'not'" | ||
case .fieldNotInType: | ||
return "The variables input contains a field that is not defined for input object type" | ||
} | ||
} | ||
|
||
/// Init RTF error based on error's debugDescription value | ||
public init?(description: String) { | ||
guard | ||
let rtfError = RTFError.allCases.first(where: { description.contains($0.uniqueMessagePart) }) | ||
else { | ||
return nil | ||
} | ||
|
||
self = rtfError | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.