Handle an odd intermittent issue and import recent changes from the wiki
This commit is contained in:
parent
a2a34c9fb3
commit
0cdbad886b
4 changed files with 10 additions and 6 deletions
|
@ -504,6 +504,10 @@ export async function getGame(pageTitle: string, cache: WikiGameCache): Promise<
|
|||
client.api, "call", params
|
||||
);
|
||||
const newTitle = data.pages[pageId.toString()].title;
|
||||
if (newTitle === undefined) {
|
||||
// This happened once intermittently; the cause is unclear.
|
||||
throw new Error("Unable to retrieve page by ID");
|
||||
}
|
||||
console.log(`:: getGame: page ${pageId} called '${pageTitle}' renamed to '${newTitle}'`);
|
||||
cache[newTitle] = cache[pageTitle];
|
||||
delete cache[pageTitle];
|
||||
|
|
Reference in a new issue