INNER CODE UNIT · Go

transformErrStr

brexhq/substation · cmd/substation/main.go:169

func transformErrStr(err error, arg string, cfg customConfig) string {
	r := transformRe.FindStringSubmatch(err.Error())

	// Cannot determine which transform failed. This should almost
	// never happen, unless something has modified the configuration
	// after it was compiled by Jsonnet.
	if len(r) == 0 {
		// Substation uses the transform name as a static transform ID.
		//
		// Example: `vet.json: transform hash_sha256: object_target_key: missing required option``
		return fmt.Sprintf("%s: %v\n", arg, err)
	}

	tfID := r[1] // The transform ID (e.g., `324f1035-10a51b9a`).

	// Prioritize returning test errors.
	for _, test := range cfg.Tests {
		for idx, tf := range test.Transforms {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…