@@ -186,17 +186,17 @@ public extension Container {
186186
187187 if let options = containerOptions {
188188 if ( options. layout. count == 0 ) {
189- throw SkyflowError ( domain: " " , code: 400 , userInfo: [ NSLocalizedDescriptionKey: " Interface: \( tempContextOptions . interface . description ) - \( ErrorCodes . EMPTY_COMPOSABLE_LAYOUT_ARRAY ( ) . description) " ] )
189+ throw SkyflowError ( domain: " " , code: 400 , userInfo: [ NSLocalizedDescriptionKey: " \( ErrorCodes . EMPTY_COMPOSABLE_LAYOUT_ARRAY ( ) . description) " ] )
190190 }
191191
192192 for i in 0 ..< ( options. layout. count) {
193193 totalCount += ( options. layout [ i] )
194194 }
195195 } else {
196- throw SkyflowError ( domain: " " , code: 400 , userInfo: [ NSLocalizedDescriptionKey: " Interface: \( tempContextOptions . interface . description ) - \( ErrorCodes . MISSING_COMPOSABLE_CONTAINER_OPTIONS ( ) . description) " ] )
196+ throw SkyflowError ( domain: " " , code: 400 , userInfo: [ NSLocalizedDescriptionKey: " \( ErrorCodes . MISSING_COMPOSABLE_CONTAINER_OPTIONS ( ) . description) " ] )
197197 }
198198 if ( elements. count < totalCount || totalCount < elements. count) {
199- throw SkyflowError ( domain: " " , code: 400 , userInfo: [ NSLocalizedDescriptionKey: " Interface: \( tempContextOptions . interface . description ) - \( ErrorCodes . MISMATCH_ELEMENT_COUNT_LAYOUT_SUM ( ) . description) " ] )
199+ throw SkyflowError ( domain: " " , code: 400 , userInfo: [ NSLocalizedDescriptionKey: " \( ErrorCodes . MISMATCH_ELEMENT_COUNT_LAYOUT_SUM ( ) . description) " ] )
200200 }
201201
202202 let view = createDynamicViews ( layout: ( containerOptions? . layout) !)
@@ -256,8 +256,8 @@ public extension Container {
256256 errorCode = . EMPTY_RECORDS_OBJECT( )
257257 return callback. onFailure ( errorCode!. getErrorObject ( contextOptions: tempContextOptions) )
258258 }
259- for record in additionalFieldEntries {
260- errorCode = checkRecord ( record: record)
259+ for (index , record) in additionalFieldEntries. enumerated ( ) {
260+ errorCode = checkRecord ( record: record, index : index )
261261 if errorCode != nil {
262262 return callback. onFailure ( errorCode!. getErrorObject ( contextOptions: tempContextOptions) )
263263 }
@@ -289,10 +289,10 @@ public extension Container {
289289
290290 private func checkElement( element: TextField ) -> ErrorCodes ? {
291291 if element. collectInput. table. isEmpty {
292- return . EMPTY_TABLE_NAME_IN_COLLECT( value : element . collectInput . type ? . name ?? " composable element " )
292+ return . EMPTY_TABLE_NAME_IN_COLLECT( )
293293 }
294294 if element. collectInput. column. isEmpty {
295- return . EMPTY_COLUMN_NAME_IN_COLLECT( value : element . collectInput . type ? . name ?? " composable element " )
295+ return . EMPTY_COLUMN_NAME_IN_COLLECT( )
296296 }
297297 if !element. isMounted ( ) {
298298 return . UNMOUNTED_COLLECT_ELEMENT( value: element. collectInput. column)
@@ -301,25 +301,25 @@ public extension Container {
301301 return nil
302302 }
303303
304- private func checkRecord( record: [ String : Any ] ) -> ErrorCodes ? {
304+ private func checkRecord( record: [ String : Any ] , index : Int ) -> ErrorCodes ? {
305305 if record [ " table " ] == nil {
306- return . TABLE_KEY_ERROR( )
306+ return . TABLE_KEY_ERROR( value : " \( index ) " )
307307 }
308308 if !( record [ " table " ] is String ) {
309- return . INVALID_TABLE_NAME_TYPE( )
309+ return . INVALID_TABLE_NAME_TYPE( value : " \( index ) " )
310310 }
311311 if ( record [ " table " ] as? String == " " ) {
312312 return . EMPTY_TABLE_NAME( )
313313 }
314314 if record [ " fields " ] == nil {
315- return . FIELDS_KEY_ERROR( )
315+ return . FIELDS_KEY_ERROR( value : " \( index ) " )
316316 }
317317 if !( record [ " fields " ] is [ String : Any ] ) {
318- return . INVALID_FIELDS_TYPE( )
318+ return . INVALID_FIELDS_TYPE( value : " \( index ) " )
319319 }
320320 let fields = record [ " fields " ] as! [ String : Any ]
321321 if ( fields. isEmpty) {
322- return . EMPTY_FIELDS_KEY( )
322+ return . EMPTY_FIELDS_KEY( value : " \( index ) " )
323323 }
324324
325325 return nil
0 commit comments