csv: don't show invalid inter-field spaces in CSV error messages
Errors involving a record like: 2000-01-01,a,"1" displayed the record with extra spaces: the CSV record is: "2000-01-01", "a", "1" which was not accurate or valid RFC-4180.
This commit is contained in:
		
							parent
							
								
									baa15d9bea
								
							
						
					
					
						commit
						d2b3185062
					
				| @ -675,7 +675,7 @@ transactionFromCsvRecord sourcepos rules record = t | ||||
|     mdate2'     = maybe Nothing (maybe (error' $ dateerror "date2" (fromMaybe "" mdate2) mdateformat) Just . mparsedate) mdate2 | ||||
|     dateerror datefield value mdateformat = unlines | ||||
|       ["error: could not parse \""++value++"\" as a date using date format "++maybe "\"YYYY/M/D\", \"YYYY-M-D\" or \"YYYY.M.D\"" show mdateformat | ||||
|       ,"the CSV record is:  "++intercalate ", " (map show record) | ||||
|       ,"the CSV record is:  "++showRecord record | ||||
|       ,"the "++datefield++" rule is:   "++(fromMaybe "required, but missing" $ mfieldtemplate datefield) | ||||
|       ,"the date-format is: "++fromMaybe "unspecified" mdateformat | ||||
|       ,"you may need to " | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user