Say why the script failed instead of just that it did
The reason was already being stored on the project, but the page showed a bare "could not finish" and a Start again button. A dead link is the most common cause and it is the reader's to fix, so it needs saying out loud.
This commit is contained in:
parent
a3af200b14
commit
b1cf3ef6f6
1 changed files with 6 additions and 1 deletions
|
|
@ -154,7 +154,12 @@ function render(r) {
|
|||
if (poll) { clearInterval(poll); poll = null; }
|
||||
|
||||
if (p.status === "script_failed") {
|
||||
out.innerHTML = '<div class="card"><p style="margin:0 0 16px">The writer could not finish this one.</p>'
|
||||
// The reason was always stored; it just was not being shown. A dead or
|
||||
// paywalled link is the usual cause, and only the reader can fix it.
|
||||
var why = (s && s.error) ? s.error : "";
|
||||
out.innerHTML = '<div class="card"><p style="margin:0 0 10px">The writer could not finish this one.</p>'
|
||||
+ (why ? '<div class="warn" style="margin:0 0 16px">' + esc(why) + '</div>'
|
||||
: '<p class="foot" style="margin:0 0 16px">No reason was recorded.</p>')
|
||||
+ '<a class="btn" style="display:inline-block;text-decoration:none" href="/create.html">Start again</a></div>';
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue