mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Show migration validation error (#22619)
Discord request: https://discord.com/channels/322538954119184384/322910365237248000/1067083214096703488 If there is a json schema validation error the full file content gets dumped into the log. That does not help and may be a lot of data. This PR prints the schema validation error message instead.
This commit is contained in:
		@@ -76,7 +76,7 @@ func validate(bs []byte, datatype interface{}, isJSON bool) error {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	err = sch.Validate(v)
 | 
						err = sch.Validate(v)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		log.Error("migration validation with %s failed for\n%s", schemaFilename, string(bs))
 | 
							log.Error("migration validation with %s failed:\n%#v", schemaFilename, err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return err
 | 
						return err
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user