Skip to content

Report preparer errors #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 31, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions src/stores/ContentRepositoryStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,38 @@ class ContentRepositoryStore {
for(let id in this.repositories) {
let r = this.repositories[id];
if (r.contentPreparerContainer && r.contentPreparerContainer.Id === container.Id) {
// This repository's preparer has completed.
r.contentPreparerContainer = null;
if (!r.isPreparing()) {
r.state = "ready";
r.hasPrepared = true;

// This repository's preparer has completed.
if (container.State.ExitCode === 0) {
// Clean exit. Hooray!
if (!r.isPreparing()) {
r.state = "ready";
r.hasPrepared = true;
}
} else if (container.State.ExitCode === 137) {
// Killed, presumably to run a new preparer.
} else {
// Boom! Something went wrong.
r.reportError(`The content preparer exited with status ${container.State.ExitCode}.`);
}
}

if (r.controlPreparerContainer && r.controlPreparerContainer.Id === container.Id) {
// The control preparer has completed.
r.controlPreparerContainer = null;
if (!r.isPreparing()) {
r.state = "ready";
r.hasPrepared = true;

if (container.State.ExitCode === 0) {
// Clean exit. Hooray!
if (!r.isPreparing()) {
r.state = "ready";
r.hasPrepared = true;
}
} else if (container.State.ExitCode === 137) {
// Killed, presumably to run a new preparer.
} else {
// Boom! Something went wrong.
r.reportError(`The control preparer exited with status ${container.State.ExitCode}.`);
}
}

Expand Down