Skip to content

Commit 7e93e91

Browse files
authored
Merge pull request #124 from feitian124/ming
parser: 解析出错时打印出错的行信息
2 parents aa38125 + f88a8c2 commit 7e93e91

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

generator-web/src/main/java/com/softdev/system/generator/util/TableParseUtil.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,13 @@ public static ClassInfo processTableIntoClassInfo(ParamInfo paramInfo)
173173
String columnName = "";
174174
columnLine = columnLine.replaceAll("`", " ").replaceAll("\"", " ").replaceAll("'", "").replaceAll(" ", " ").trim();
175175
//如果遇到username varchar(65) default '' not null,这种情况,判断第一个空格是否比第一个引号前
176-
columnName = columnLine.substring(0, columnLine.indexOf(" "));
176+
try {
177+
columnName = columnLine.substring(0, columnLine.indexOf(" "));
178+
} catch (StringIndexOutOfBoundsException e) {
179+
System.out.println("err happened: " + columnLine);
180+
throw e;
181+
}
182+
177183
// field Name
178184
// 2019-09-08 yj 添加是否下划线转换为驼峰的判断
179185
String fieldName = null;

0 commit comments

Comments
 (0)