@@ -122,10 +122,36 @@ namespace NKikimr {
122
122
123
123
Send (MonActor, new TEvBlobStorage::TEvConfigureProxy (Info, nullptr ));
124
124
if (Info) {
125
- Y_ABORT_UNLESS (!EncryptionMode || *EncryptionMode == Info->GetEncryptionMode ());
126
- Y_ABORT_UNLESS (!LifeCyclePhase || *LifeCyclePhase == Info->GetLifeCyclePhase ());
127
- Y_ABORT_UNLESS (!GroupKeyNonce || *GroupKeyNonce == Info->GetGroupKeyNonce ());
128
- Y_ABORT_UNLESS (!CypherKey || *CypherKey == *Info->GetCypherKey ());
125
+ auto printOptional = [&](const auto & val, bool printValue) -> TString {
126
+ using T = std::decay_t <decltype (*val)>;
127
+ if (!val) {
128
+ return " <nullopt>" ;
129
+ } else {
130
+ if (printValue) {
131
+ if constexpr (std::is_same_v<T, ui64>) {
132
+ return IntToString<10 >(*val);
133
+ }
134
+ if constexpr (std::is_same_v<T, TBlobStorageGroupInfo::EEncryptionMode>) {
135
+ return TBlobStorageGroupInfo::PrintEncryptionMode (*val);
136
+ }
137
+ if constexpr (std::is_same_v<T, TBlobStorageGroupInfo::ELifeCyclePhase>) {
138
+ return TBlobStorageGroupInfo::PrintLifeCyclePhase (*val);
139
+ }
140
+ return " " ;
141
+ } else {
142
+ return " <value>" ;
143
+ }
144
+ }
145
+ };
146
+
147
+ Y_VERIFY_S (!EncryptionMode || *EncryptionMode == Info->GetEncryptionMode (),
148
+ " EncryptionMode# " << printOptional (EncryptionMode, true ) << " Info# " << Info->ToString ());
149
+ Y_VERIFY_S (!LifeCyclePhase || *LifeCyclePhase == Info->GetLifeCyclePhase (),
150
+ " LifeCyclePhase# " << printOptional (LifeCyclePhase, true ) << " Info# " << Info->ToString ());
151
+ Y_VERIFY_S (!GroupKeyNonce || *GroupKeyNonce == Info->GetGroupKeyNonce (),
152
+ " GroupKeyNonce# " << printOptional (GroupKeyNonce, true ) << " Info# " << Info->ToString ());
153
+ Y_VERIFY_S (!CypherKey || *CypherKey == *Info->GetCypherKey (),
154
+ " CypherKey# " << printOptional (CypherKey, false ) << " Info# " << Info->ToString ());
129
155
EncryptionMode = Info->GetEncryptionMode ();
130
156
LifeCyclePhase = Info->GetLifeCyclePhase ();
131
157
GroupKeyNonce = Info->GetGroupKeyNonce ();
0 commit comments