@@ -753,17 +753,17 @@ object EncodingHints {
753753 */
754754sealed trait EncodingError extends FlowForgeError
755755case class UnsupportedFormat (format : DataFormat , dataType : String ) extends EncodingError {
756- val message = s " Format $format is not supported for data type $dataType"
757- val category = ErrorCategory .Validation
758- val severity = ErrorSeverity .Error
759- val context = Map (" format" -> format.toString, " dataType" -> dataType)
760- val cause = None
756+ val message = s " Format $format is not supported for data type $dataType"
757+ val category = ErrorCategory .Validation
758+ val severity = ErrorSeverity .Error
759+ val context = Map (" format" -> ContextValue . Text ( format.toString) , " dataType" -> ContextValue . Text ( dataType) )
760+ val cause = None
761761 val timestamp = Instant .now()
762762 val errorId = java.util.UUID .randomUUID().toString
763763 val isRetryable = false
764764 val recoveryHints = List (" Use a supported format" , " Implement custom encoder" )
765765
766- def withContext (additionalContext : Map [String , Any ]): EncodingError =
766+ def withContext (additionalContext : Map [String , ContextValue ]): EncodingError =
767767 copy() // Simplified for brevity
768768 def withCause (underlyingCause : Throwable ): EncodingError =
769769 copy() // Simplified for brevity
@@ -777,14 +777,14 @@ case class CorruptedData(details: String) extends DecodingError {
777777 val message = s " Data is corrupted: $details"
778778 val category = ErrorCategory .Validation
779779 val severity = ErrorSeverity .Error
780- val context = Map (" details" -> details)
780+ val context = Map (" details" -> ContextValue . Text ( details) )
781781 val cause = None
782782 val timestamp = Instant .now()
783783 val errorId = java.util.UUID .randomUUID().toString
784784 val isRetryable = false
785785 val recoveryHints = List (" Check data source" , " Re-download data" , " Use backup data" )
786786
787- def withContext (additionalContext : Map [String , Any ]): DecodingError =
787+ def withContext (additionalContext : Map [String , ContextValue ]): DecodingError =
788788 copy() // Simplified for brevity
789789 def withCause (underlyingCause : Throwable ): DecodingError =
790790 copy() // Simplified for brevity
@@ -797,16 +797,17 @@ sealed trait SchemaError extends FlowForgeError
797797case class SchemaIncompatible (expected : DataSchema , actual : DataSchema ) extends SchemaError {
798798 val message =
799799 s " Schema incompatible: expected ${expected.fields.length} fields, got ${actual.fields.length}"
800- val category = ErrorCategory .Validation
801- val severity = ErrorSeverity .Error
802- val context = Map (" expected" -> expected.toString, " actual" -> actual.toString)
800+ val category = ErrorCategory .Validation
801+ val severity = ErrorSeverity .Error
802+ val context =
803+ Map (" expected" -> ContextValue .Text (expected.toString), " actual" -> ContextValue .Text (actual.toString))
803804 val cause = None
804805 val timestamp = Instant .now()
805806 val errorId = java.util.UUID .randomUUID().toString
806807 val isRetryable = false
807808 val recoveryHints = List (" Update schema" , " Enable schema evolution" , " Transform data" )
808809
809- def withContext (additionalContext : Map [String , Any ]): SchemaError =
810+ def withContext (additionalContext : Map [String , ContextValue ]): SchemaError =
810811 copy() // Simplified for brevity
811812 def withCause (underlyingCause : Throwable ): SchemaError =
812813 copy() // Simplified for brevity
@@ -820,14 +821,14 @@ case class SerializationFailed(reason: String) extends SerializationError {
820821 val message = s " Serialization failed: $reason"
821822 val category = ErrorCategory .System
822823 val severity = ErrorSeverity .Error
823- val context = Map (" reason" -> reason)
824+ val context = Map (" reason" -> ContextValue . Text ( reason) )
824825 val cause = None
825826 val timestamp = Instant .now()
826827 val errorId = java.util.UUID .randomUUID().toString
827828 val isRetryable = true
828829 val recoveryHints = List (" Retry operation" , " Check data format" , " Use alternative serializer" )
829830
830- def withContext (additionalContext : Map [String , Any ]): SerializationError =
831+ def withContext (additionalContext : Map [String , ContextValue ]): SerializationError =
831832 copy() // Simplified for brevity
832833 def withCause (underlyingCause : Throwable ): SerializationError =
833834 copy() // Simplified for brevity
@@ -841,14 +842,14 @@ case class RuleViolation(ruleName: String, details: String) extends ContractViol
841842 val message = s " Contract rule ' $ruleName' violated: $details"
842843 val category = ErrorCategory .Business
843844 val severity = ErrorSeverity .Error
844- val context = Map (" rule" -> ruleName, " details" -> details)
845+ val context = Map (" rule" -> ContextValue . Text ( ruleName) , " details" -> ContextValue . Text ( details) )
845846 val cause = None
846847 val timestamp = Instant .now()
847848 val errorId = java.util.UUID .randomUUID().toString
848849 val isRetryable = false
849850 val recoveryHints = List (" Fix data quality" , " Update contract rules" , " Contact data owner" )
850851
851- def withContext (additionalContext : Map [String , Any ]): ContractViolation =
852+ def withContext (additionalContext : Map [String , ContextValue ]): ContractViolation =
852853 copy() // Simplified for brevity
853854 def withCause (underlyingCause : Throwable ): ContractViolation =
854855 copy() // Simplified for brevity
0 commit comments