From 0b0a89cb3dc04471c250d361a0a4d75662fac426 Mon Sep 17 00:00:00 2001 From: varnit goyal Date: Wed, 20 Nov 2024 17:32:14 +0530 Subject: [PATCH] TP-5555 | device contexts --- models/es/ErrorDocument.go | 1 + service/ErrorProcessor.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/models/es/ErrorDocument.go b/models/es/ErrorDocument.go index c6dd83a..4ccf52a 100644 --- a/models/es/ErrorDocument.go +++ b/models/es/ErrorDocument.go @@ -14,4 +14,5 @@ type ErrorDocument struct { Breadcrumbs interface{} `json:"breadcrumbs"` Extra interface{} `json:"extra"` Request interface{} `json:"request"` + Contexts interface{} `json:"contexts"` } diff --git a/service/ErrorProcessor.go b/service/ErrorProcessor.go index 640a0f1..ebe437f 100644 --- a/service/ErrorProcessor.go +++ b/service/ErrorProcessor.go @@ -60,6 +60,7 @@ type Exception struct { Breadcrumbs interface{} `json:"breadcrumbs,omitempty"` Extra interface{} `json:"extra,omitempty"` Request interface{} `json:"request,omitempty"` + Contexts interface{} `json:"contexts,omitempty"` } func NewErrorProcessor(logger *log.Logger, elasticSearchClient *dbPackage.ElasticSearchClient, sourceMapFetcherService *SourceMapService, awsConfig configs.AwsConfig) *ErrorProcessor { @@ -195,10 +196,11 @@ func (ep *ErrorProcessor) ProcessError(error []byte) { Breadcrumbs: payload.Breadcrumbs, Extra: payload.Extra, Request: payload.Request, + Contexts: payload.Contexts, } elastic_err := ep.elasticSearchClient.IndexDocument(errorDocument) if elastic_err != nil { - ep.logger.Info("error occured in elasticsearch", zap.Error(elastic_err)) + ep.logger.Info("error occured in saving document to elasticsearch", zap.Error(elastic_err)) return } }