Skip to content

Commit

Permalink
feat: 碰到未收錄的項目名稱會提示使用者要怎麼回報
Browse files Browse the repository at this point in the history
奇怪以前我怎麼沒寫 try ??
  • Loading branch information
hms5232 committed Nov 18, 2020
1 parent 3f05b7b commit 46ab316
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ufw_log_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ def main():
for j in get_expect_time(ufw_logs[i]).items():
record[j[0]] = j[1]

writer.writerow(record) # 寫入一列
try:
writer.writerow(record) # 寫入一列
except ValueError:
print() # 避免第幾筆紀錄的輸出被覆蓋掉
print("紀錄中出現了程式碼中沒有的欄位!請複製錯誤紀錄及該筆原始 log 發起 issue 或自行更新後發 Pull request。\n")
print("\thttps://github.com/hms5232/ufw-log-to-csv/issues")
print("\n===== 以下錯誤紀錄 =====\n")
raise
except:
raise

print(end='\n\n') # 讓之前 print 出來的東西不會被覆蓋(\r\n)順便排版

Expand Down

0 comments on commit 46ab316

Please sign in to comment.