Merge branch 'feature/register_model_default_parameter' into 'develop'
Update for convenience in registration of models that replace ### Summary Update for convenience in registration of models that replace ### JIRA Ticket https://onejira.verizon.com/browse/ONEAPP-7459 Co-authored-by: Scott Pfeil <Scott.Pfeil3@verizonwireless.com> See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core/-/merge_requests/330
This commit is contained in:
commit
8f88e94ed8
@ -50,9 +50,9 @@ public struct ModelRegistry {
|
|||||||
|
|
||||||
/// A convenience wrapping function where error handling is managed within the class.
|
/// A convenience wrapping function where error handling is managed within the class.
|
||||||
/// - Parameter type: Takes an object of ModelProtocol.self which is used to register
|
/// - Parameter type: Takes an object of ModelProtocol.self which is used to register
|
||||||
public static func register<M: ModelProtocol>(_ type: M.Type) {
|
public static func register<M: ModelProtocol>(_ type: M.Type, allowsReplace: Bool = false) {
|
||||||
do {
|
do {
|
||||||
try throwable_register(type: type)
|
try throwable_register(type: type, allowsReplace: allowsReplace)
|
||||||
} catch {
|
} catch {
|
||||||
handleError(error)
|
handleError(error)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user