Skip to content

Commit

Permalink
fix: improved error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Jan 12, 2020
1 parent 4db112a commit 95eeb6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/@nodepack/db-migrator/src/lib/Migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class Migrator extends EnvMigrator {
const data = await this.context.readDbMigrationRecords()
this.fileMigrationRecords = data.files
} catch (e) {
consola.error('Could not read migration records. Error:', e.stack)
consola.error('Could not read migration records. Error:', e.stack || e)
this.fileMigrationRecords = []
}
}
Expand All @@ -43,7 +43,7 @@ export class Migrator extends EnvMigrator {
plugins: [],
})
} catch (e) {
consola.error('Could not write migration records. Error:', e.stack)
consola.error('Could not write migration records. Error:', e.stack || e)
}
}
}
6 changes: 3 additions & 3 deletions packages/@nodepack/env-migrator/src/lib/Migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class Migrator {
})
count++
} catch (e) {
consola.error(`Migration failed for ${module.file}\n${e.stack || e.message}`)
consola.error(`Migration failed for ${module.file}:`, e.stack || e)
await this.writeMigrationRecords()
process.exit(1)
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export class Migrator {
const data = await readConfigFile(this.cwd, FILE_ENV_MIGRATIONS_RECORDS)
this.fileMigrationRecords = data.files
} catch (e) {
consola.error('Could not read migration records. Error:', e.stack)
consola.error('Could not read migration records. Error:', e.stack || e)
this.fileMigrationRecords = []
}
}
Expand All @@ -133,7 +133,7 @@ export class Migrator {
plugins: [],
})
} catch (e) {
consola.error('Could not write migration records. Error:', e.stack)
consola.error('Could not write migration records. Error:', e.stack || e)
}
}
}
2 changes: 1 addition & 1 deletion packages/@nodepack/service/src/commands/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ module.exports = (api, options) => {
child.kill('SIGINT')
return true
} catch (e) {
consola.error(`Couldn't terminate process ${child.pid}: ${e}`)
consola.error(`Couldn't terminate process ${child.pid}:`, e.stack || e)
}
}

Expand Down

0 comments on commit 95eeb6a

Please sign in to comment.