Skip to content

Commit

Permalink
cont
Browse files Browse the repository at this point in the history
  • Loading branch information
pbatko-da committed Nov 22, 2021
1 parent 39cd20c commit 6676d55
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object ErrorCodeInventoryDocsGenApp {

val groupSegmentsToExplanationMap: Map[List[Grouping], Option[String]] =
groupDocItems.map { groupDocItem: GroupDocItem =>
groupDocItem.errorGroupPath.groupings -> groupDocItem.explanation.map(_.explanation)
groupDocItem.errorClass.groupings -> groupDocItem.explanation.map(_.explanation)
}.toMap

val errorCodes: Seq[ErrorCodeValue] = errorDocItems.map { (errorDocItem: ErrorDocItem) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ object Main {
Encoder.forProduct2(
"docName",
"className",
)((grouping: Grouping) =>
)(i =>
(
grouping.docName,
grouping.fullClassName,
i.docName,
i.fullClassName,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ErrorCodeDocumentationGenerator(prefixes: Array[String] = Array("com.daml"
ErrorDocItem(
className = error.getClass.getName,
category = simpleClassName(error.category),
hierarchicalGrouping = error.errorGroupPath,
hierarchicalGrouping = error.parent,
conveyance = error.errorConveyanceDocString,
code = error.id,
deprecation = deprecation,
Expand All @@ -79,7 +79,7 @@ class ErrorCodeDocumentationGenerator(prefixes: Array[String] = Array("com.daml"
getGroupDocumentationAnnotations(group)

GroupDocItem(
errorGroupPath = group.errorClass,
errorClass = group.errorClass,
className = group.fullClassName,
explanation = explanation,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import com.daml.error.{ErrorClass, Explanation}
*
* @param className The group class name (see [[com.daml.error.ErrorGroup]]).
* @param explanation The detailed error explanation.
* @param errorGroupPath Hierarchical grouping of this error group.
* @param errorClass Hierarchical grouping of this error group.
*/
case class GroupDocItem(
className: String,
explanation: Option[Explanation],
errorGroupPath: ErrorClass,
errorClass: ErrorClass,
)
4 changes: 2 additions & 2 deletions ledger/error/src/main/scala/com/daml/error/ErrorClass.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ case class Grouping(
/** Used to hierarchically structure error codes in the official documentation.
*/
case class ErrorClass(groupings: List[Grouping]) {
def extend(last: Grouping): ErrorClass =
ErrorClass(groupings :+ last)
def extend(grouping: Grouping): ErrorClass =
ErrorClass(groupings :+ grouping)
}

object ErrorClass {
Expand Down
2 changes: 1 addition & 1 deletion ledger/error/src/main/scala/com/daml/error/ErrorCode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import scala.util.matching.Regex
* }
*/
abstract class ErrorCode(val id: String, val category: ErrorCategory)(implicit
val errorGroupPath: ErrorClass
val parent: ErrorClass
) {

require(id.nonEmpty, "error-id must be non empty")
Expand Down

0 comments on commit 6676d55

Please sign in to comment.