{"record":{"id":"1d91636ecb63b564","repo":"sipeed/picoclaw","slug":"failed-to-create-table-w","errorCode":null,"errorMessage":"failed to create table: %w","messagePattern":"failed to create table: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/teams_webhook/teams_webhook.go","lineNumber":366,"sourceCode":"\t\t\t\tType:  adaptivecard.TypeTableCell,\n\t\t\t\tItems: []*adaptivecard.Element{&textBlock},\n\t\t\t}\n\t\t\ttableCells = append(tableCells, cell)\n\t\t}\n\t\tallRows = append(allRows, tableCells)\n\t}\n\n\tif len(allRows) == 0 {\n\t\treturn adaptivecard.Element{}, fmt.Errorf(\"no valid rows found in table\")\n\t}\n\n\t// Create table with first row as headers\n\tfirstRowAsHeaders := true\n\tshowGridLines := true\n\n\ttable, err := adaptivecard.NewTableFromTableCells(allRows, 0, firstRowAsHeaders, showGridLines)\n\tif err != nil {\n\t\treturn adaptivecard.Element{}, fmt.Errorf(\"failed to create table: %w\", err)\n\t}\n\n\t// Set column widths based on header content length\n\ttable.Columns = calculateColumnWidths(headerLengths)\n\n\treturn table, nil\n}\n\n// calculateColumnWidths creates TableColumnDefinition entries with widths\n// proportional to the max content length of each column.\nfunc calculateColumnWidths(maxLengths []int) []adaptivecard.Column {\n\tif len(maxLengths) == 0 {\n\t\treturn nil\n\t}\n\n\t// Use content length as relative weight, with a minimum of 1\n\tcolumns := make([]adaptivecard.Column, len(maxLengths))\n\tfor i, length := range maxLengths {","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/teams_webhook/teams_webhook.go#L348-L384","documentation":"Returned by parseMarkdownTable when adaptivecard.NewTableFromTableCells rejects the assembled cell grid — typically a row/column structure the library considers invalid (e.g. inconsistent column counts). The library error is wrapped with %w.","triggerScenarios":"Thrown at pkg/channels/teams_webhook/teams_webhook.go:366 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the exact constraint violated","Normalize the markdown table so every row has the same number of columns","Simplify the table and retry the card build"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}