فهرست منبع

* lib.go: Actually tell me what the bad reference was in an excel cell.

Geoffrey Teale 14 سال پیش
والد
کامیت
03188f340e
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      lib.go

+ 2 - 1
lib.go

@@ -2,6 +2,7 @@ package xlsx
 
 
 import (
 import (
 	"archive/zip"
 	"archive/zip"
+	"fmt"
 	"io"
 	"io"
 	"os"
 	"os"
 	"strconv"
 	"strconv"
@@ -70,7 +71,7 @@ func readRowsFromSheet(worksheet *XLSXWorksheet, reftable []string) []*Row {
 			cell := new(Cell)
 			cell := new(Cell)
 			ref, error := strconv.Atoi(rawcell.V.Data)
 			ref, error := strconv.Atoi(rawcell.V.Data)
 			if error != nil {
 			if error != nil {
-				panic("Invalid reference in Excel Cell (not found in sharedStrings.xml")
+				panic(fmt.Sprintf("Invalid reference in Excel Cell (not found in sharedStrings.xml) - the reference was %v\n", rawcell.V.Data))
 			}
 			}
 			cell.data = reftable[ref]
 			cell.data = reftable[ref]
 			row.Cells[j] = cell
 			row.Cells[j] = cell