diff --git a/web/src/app/browser/src/contextManager.ts b/web/src/app/browser/src/contextManager.ts index 9598227110..2b58a598cb 100644 --- a/web/src/app/browser/src/contextManager.ts +++ b/web/src/app/browser/src/contextManager.ts @@ -531,8 +531,8 @@ export class ContextManager extends ContextManagerBase { this.engineConfig.alertHost?.wait(); // clear the wait message box, either way. - const message = (err as Error)?.message || - 'Sorry, the ' + keyboardId + ' keyboard for ' + languageCode + ' is not currently available.'; + + const message = `Activation of '${keyboardId}' failed: ${(err as Error)?.message ?? err?.toString() ?? 'unknown error'}`; if(err instanceof KeyboardScriptError) { // We get signaled about error log messages if the site is connected to our Sentry error reporting diff --git a/web/src/engine/src/main/contextManagerBase.ts b/web/src/engine/src/main/contextManagerBase.ts index e9ddd9a18a..8554c124bc 100644 --- a/web/src/engine/src/main/contextManagerBase.ts +++ b/web/src/engine/src/main/contextManagerBase.ts @@ -368,7 +368,7 @@ export abstract class ContextManagerBase const keyboardPromise = this.keyboardCache.fetchKeyboard(requestedStub.KI); const timeoutPromise = new Promise((resolve, reject) => { - const timeoutMsg = `Sorry, the ${requestedStub.name} keyboard for ${requestedStub.langName} is not currently available.`; + const timeoutMsg = `Download of ${requestedStub.KI} for language ${requestedStub.langId} timed out.`; window.setTimeout(() => reject(new Error(timeoutMsg)), ContextManagerBase.TIMEOUT_THRESHOLD); }); diff --git a/web/src/test/manual/web/keyboard-errors/errorhdr.js b/web/src/test/manual/web/keyboard-errors/errorhdr.js index b8e1dd25f9..fbf8f8d474 100644 --- a/web/src/test/manual/web/keyboard-errors/errorhdr.js +++ b/web/src/test/manual/web/keyboard-errors/errorhdr.js @@ -35,6 +35,8 @@ id:'lo',name:'debugging',region:'Asia', font:{family:'LaoWeb',source:['../font/saysettha_web.ttf','../font/saysettha_web.woff','../font/saysettha_web.eot']} }, - filename:'./timeout.js' // Intentional (simulated) error - the file never loads, simulating a server timeout. + filename: './timeout.js' // Intentional (simulated) error - the file never loads, + // simulating a server timeout. web/src/tools/testing/test-server/index.cjs#L12 + // has special code when this file gets requested! }); } diff --git a/web/src/test/manual/web/keyboard-errors/index.html b/web/src/test/manual/web/keyboard-errors/index.html index e00e2f714c..790e27458d 100644 --- a/web/src/test/manual/web/keyboard-errors/index.html +++ b/web/src/test/manual/web/keyboard-errors/index.html @@ -64,9 +64,12 @@
  • wrong-filename keyboard: "Unable to download wrong-filename keyboard for debugging"
  • non-parsable keyboard: "Error registering the non-parsable keyboard for debugging; keyboard script at ./unparsable.js may contain an error."
  • -
  • timeout keyboard: "Sorry, the timeout keyboard for debugging is not currently available."
  • +
  • timeout keyboard: "Activation of 'Keyboard_timeout' failed: Download of Keyboard_timeout for language lo timed out."
+

Note: This test page will only work on the local test server due to its + specific requirements for handling the 'timeout.js' file.

+

Return to testing home page

@@ -75,7 +78,11 @@ const body = document.getElementsByTagName('body')[0]; body.innerHTML = `

KeymanWeb Sample Page - Error Testing page

Unable to load this test page!

-

This page has to be loaded through the local test server.

+

This test page will only work on the local test server because it + requires special treatment when loading timeout.js + (see + web/src/tools/testing/test-server/index.cjs#L12). The + page has to be loaded through the local test server.

Do the following:

  1. Open a terminal and navigate to the Keyman source root directory