mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
9a8b8351b1
Accumulate div block modeling warnings Не фатальные ошибки (при наличии фоллбэка) поменял на ворнинги, которые так же репортятся в externalLogger с другим префиксом и дополнительно собираются в контексте. Добавил им path. Дополнительно поменял репорт ошибки в логгер на выброс исключения при попытке создания divCircleShape, который не поддерживается - кажется, так будет правильней.
27 lines
641 B
Swift
27 lines
641 B
Swift
import Foundation
|
|
|
|
import CommonCore
|
|
import LayoutKit
|
|
|
|
public protocol DivBlockModeling {
|
|
func makeBlock(context: DivBlockModelingContext) throws -> Block
|
|
}
|
|
|
|
public struct DivBlockModelingError: Error, CustomStringConvertible, Equatable {
|
|
public let description: String
|
|
|
|
init(_ message: String, path: UIElementPath) {
|
|
description = "\(message) [\(path)]"
|
|
DivKitLogger.error(description)
|
|
}
|
|
}
|
|
|
|
public struct DivBlockModelingWarning: CustomStringConvertible {
|
|
public let description: String
|
|
|
|
init(_ message: String, path: UIElementPath) {
|
|
description = "\(message) [\(path)]"
|
|
DivKitLogger.warning(description)
|
|
}
|
|
}
|