diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d4b4d8..b79c2d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v0.8.0] - 2018-07-19 +### Added +- Output details of any error on task failure (#46). + ## [v0.7.1] - 2018-07-13 ### Fixed - Unable to obtain logs on remote swarm (#44). @@ -56,4 +60,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [v0.6.0]: https://github.com/markbirbeck/docker-job/compare/v0.5.0...v0.6.0 [v0.7.0]: https://github.com/markbirbeck/docker-job/compare/v0.6.0...v0.7.0 [v0.7.1]: https://github.com/markbirbeck/docker-job/compare/v0.7.0...v0.7.1 -[Unreleased]: https://github.com/markbirbeck/docker-job/compare/v0.7.1...HEAD +[v0.8.0]: https://github.com/markbirbeck/docker-job/compare/v0.7.0...v0.8.0 +[Unreleased]: https://github.com/markbirbeck/docker-job/compare/v0.8.0...HEAD diff --git a/package.json b/package.json index 9e50c02..afc97dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docker-job", - "version": "0.7.1", + "version": "0.8.0", "description": "Run a single job as a Docker Service on Docker Swarm", "bin": { "dj": "./src/bin/cli.js" diff --git a/src/lib/service-client.js b/src/lib/service-client.js index aba762c..a0c5851 100644 --- a/src/lib/service-client.js +++ b/src/lib/service-client.js @@ -199,7 +199,13 @@ class ServiceClient { await cb(task) } catch(e) { process.exitCode = -1 - console.error(`${task.ID}: ${e.message}`) + /** + * If we've had an error then get the task's status for the error + * message: + */ + + const state = await this.inspectTask(task.ID) + console.error(`${task.ID}: ${e.message}: "${state.Status.Err} (${state.Status.State})"`) } } } while (!foundTask)