mirror of
https://github.com/scratchfoundation/scratch-l10n.git
synced 2024-12-22 13:42:30 -05:00
More error reporting
Provide more details about content and language that caused errors to diagnose translation errors.
This commit is contained in:
parent
d094f9c2e7
commit
0707c98d25
1 changed files with 8 additions and 2 deletions
|
@ -27,6 +27,9 @@ class FreshdeskApi {
|
||||||
}
|
}
|
||||||
let err = new Error(`response ${res.statusText}`);
|
let err = new Error(`response ${res.statusText}`);
|
||||||
err.code = res.status;
|
err.code = res.status;
|
||||||
|
if (res.status === 429) {
|
||||||
|
err.retryAfter = res.headers.get('Retry-After');
|
||||||
|
}
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +82,10 @@ class FreshdeskApi {
|
||||||
.then(this.checkStatus)
|
.then(this.checkStatus)
|
||||||
.then(res => res.json());
|
.then(res => res.json());
|
||||||
}
|
}
|
||||||
// re-raise the error otherwise
|
if (err.code === 429) {
|
||||||
|
this.rateLimited = true;
|
||||||
|
}
|
||||||
|
process.stdout.write(`Error processing id ${id} for locale ${locale}: ${err.message}\n`);
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -149,7 +155,7 @@ class FreshdeskApi {
|
||||||
if (err.code === 429) {
|
if (err.code === 429) {
|
||||||
this.rateLimited = true;
|
this.rateLimited = true;
|
||||||
}
|
}
|
||||||
// re-raise the error otherwise
|
process.stdout.write(`Error processing id ${id} for locale ${locale}: ${err.message}\n`);
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue