feat: return error on unmarshal failed
This commit is contained in:
		
							parent
							
								
									b95f2187e3
								
							
						
					
					
						commit
						0cf87fa332
					
				| 
						 | 
				
			
			@ -50,7 +50,16 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
 | 
			
		|||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		var record Record
 | 
			
		||||
		_ = json.Unmarshal([]byte(line), &record)
 | 
			
		||||
		err := json.Unmarshal([]byte(line), &record)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return stage.ParserResult{
 | 
			
		||||
				Score: 0,
 | 
			
		||||
				Comment: fmt.Sprintf(
 | 
			
		||||
					"Unexpected parser error: %s.",
 | 
			
		||||
					err,
 | 
			
		||||
				),
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		records = append(records, record)
 | 
			
		||||
	}
 | 
			
		||||
	comment, score, err := GetResult(records, conf)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user