mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Expose more information for migration status errors (#240)
We saw these errors live today and it would be helpful to have the additional error context for debugging.
This commit is contained in:
parent
bb124dc2b9
commit
ac9a85ab88
@ -193,22 +193,22 @@ func (d *Datastore) MigrationStatus() (kolide.MigrationStatus, error) {
|
|||||||
|
|
||||||
lastTablesMigration, err := tables.MigrationClient.Migrations.Last()
|
lastTablesMigration, err := tables.MigrationClient.Migrations.Last()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.New("missing tables migrations")
|
return 0, errors.Wrap(err, "missing tables migrations")
|
||||||
}
|
}
|
||||||
|
|
||||||
currentTablesVersion, err := tables.MigrationClient.GetDBVersion(d.db.DB)
|
currentTablesVersion, err := tables.MigrationClient.GetDBVersion(d.db.DB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.New("cannot get table migration status")
|
return 0, errors.Wrap(err, "cannot get table migration status")
|
||||||
}
|
}
|
||||||
|
|
||||||
lastDataMigration, err := data.MigrationClient.Migrations.Last()
|
lastDataMigration, err := data.MigrationClient.Migrations.Last()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.New("missing data migrations")
|
return 0, errors.Wrap(err, "missing data migrations")
|
||||||
}
|
}
|
||||||
|
|
||||||
currentDataVersion, err := data.MigrationClient.GetDBVersion(d.db.DB)
|
currentDataVersion, err := data.MigrationClient.GetDBVersion(d.db.DB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, errors.New("cannot get table migration status")
|
return 0, errors.Wrap(err, "cannot get data migration status")
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
Loading…
Reference in New Issue
Block a user