The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/apps/dashboard/pkg/migration/schemaversion/errors.go

25 lines
672 B

package schemaversion
import "fmt"
var _ error = &MigrationError{}
// ErrMigrationFailed is an error that is returned when a migration fails.
func NewMigrationError(msg string, currentVersion, targetVersion int) *MigrationError {
return &MigrationError{
msg: msg,
targetVersion: targetVersion,
currentVersion: currentVersion,
}
}
// MigrationError is an error type for migration errors.
type MigrationError struct {
msg string
targetVersion int
currentVersion int
}
func (e *MigrationError) Error() string {
return fmt.Errorf("schema migration from version %d to %d failed: %v", e.currentVersion, e.targetVersion, e.msg).Error()
}