MCPcopy Index your code
hub / github.com/coder/coder / friendlyError

Function friendlyError

scripts/migrate-test/main.go:108–115  ·  view source on GitHub ↗
(w io.Writer, err error, v1, v2 string)

Source from the content-addressed store, hash-verified

106}
107
108func friendlyError(w io.Writer, err error, v1, v2 string) {
109 _, _ = fmt.Fprintf(w, "Migrating from version %q to %q failed:\n", v1, v2)
110 _, _ = fmt.Fprintf(w, "\t%s\n", err.Error())
111 _, _ = fmt.Fprintf(w, "Check the following:\n")
112 _, _ = fmt.Fprintf(w, " - All migrations from version %q must exist in version %q with the same migration numbers.\n", v2, v1)
113 _, _ = fmt.Fprintf(w, " - Each migration must have the same effect.\n")
114 _, _ = fmt.Fprintf(w, " - There must be no gaps or duplicates in the migration numbers.\n")
115}
116
117func makeMigrateFS(version string) (fs.FS, error) {
118 // Export the migrations from the requested version to a zip archive

Callers 1

mainFunction · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected