Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ object CollectionTOCUtil {
returnDIALCodes.asScala.toList.map(rec => rec.asScala.toMap[String,AnyRef]).map(_.getOrElse(CollectionTOCConstants.IDENTIFIER, "")).asInstanceOf[List[String]]
}
catch {
case e:Exception => println("CollectionTOCUtil: validateDIALCodes --> exception: " + e.getMessage)
List.empty
case e: Exception =>
TelemetryManager.error("CollectionTOCUtil: validateDIALCodes --> exception: " + e.getMessage, e)
throw new ServerException("ERR_DIALCODE_VALIDATION", "Error while parsing DIAL code validation response: " + e.getMessage)
}
}

Expand Down Expand Up @@ -94,8 +95,9 @@ object CollectionTOCUtil {
contentList ++ questionSetList
}
catch {
case ex:Exception => TelemetryManager.info("CollectionTOCUtil --> searchLinkedContents --> Exception:: " + ex.getMessage)
List.empty
case ex: Exception =>
TelemetryManager.error("CollectionTOCUtil --> searchLinkedContents --> Exception: " + ex.getMessage, ex)
throw new ServerException("ERR_LINKED_CONTENT_SEARCH", "Error while parsing linked contents search response: " + ex.getMessage)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.mashape.unirest.http.Unirest
import org.apache.commons.collections4.CollectionUtils
import org.apache.commons.lang3.StringUtils
import org.sunbird.common.JsonUtils
import org.sunbird.telemetry.logger.TelemetryManager

import scala.jdk.CollectionConverters._
import scala.collection.mutable.ListBuffer
Expand Down Expand Up @@ -103,8 +104,8 @@ object ChannelManager {
metadata.put("additionalCategories", additionalCategories)
} catch {
case e: Exception =>
// Log error and continue without populating categories
System.out.println("Error fetching primary/additional categories: " + e.getMessage)
// Log error and continue; defaults are already populated above via putIfAbsent
TelemetryManager.error("Error fetching primary/additional categories: " + e.getMessage, e)
}
}

Expand Down