Errors and problems

What an error of the SDK carries, what the SDK reports to Quran Lab, and what your app's Problems tab shows.

Every failure of the SDK is an error with a code, a message and a line about what to do; Errors lists every code. The SDK also reports each failure a learner hits to Quran Lab, with no identifier, and your app's Problems tab shows them. Most learners never write to say that something failed. This is how you find out.

The code your app gets

Each code means one thing, so your app can act on it.

What happened The code
A request the call cannot go without got no answer at all: the device is offline, a name does not resolve, a connection is refused needs_connection
A server answered with a failure: a server error, a "too many requests" answer, or an answer that is not what was asked download_failed, whose message names the answer
Quran Lab refused the key or the app invalid_key, or server_rejected with the reason
The SDK is older than the oldest one Quran Lab still serves sdk_too_old
The browser or device lacks something the SDK needs, such as WebAssembly or WebCrypto runtime_unsupported, naming it
Not enough memory to start the engine or open the model engine_failed
The device's storage is full, or fails in another way storage_full, or storage_failed
A downloaded file is not the file that was published checksum_mismatch, or signature_invalid

So needs_connection is never the answer of a server. The device could not reach Quran Lab: ask the learner to connect, then try again. For download_failed, try again later; a download resumes where it stopped.

The cause

Each error also carries its cause: where it failed and why, as short tokens your app can log, choose its words by, and send with a support request. They are the same tokens the Problems tab shows.

SDK Where the cause is
Android error.errorCause
iOS and macOS error.cause
Web error.errorCause
Flutter error.cause
Windows and Linux tf_last_error_cause(&cause), on the thread where the call failed
  • stage and reason: where it failed and why.
  • httpStatus, errorName and errorCode, when there is one: the status of the server's answer, and the name and code of the system's error.
  • needs, on needs_connection only. model: the model's files are not on the device yet, so the learner connects to download them. lease: the model is on the device and needs Quran Lab's answer to open, so the learner connects to continue.

A cause never holds a message, a path, an address or an identifier. The five codes that only say the app used the API wrongly have none: invalid_argument, client_exists, session_open, session_closed and cancelled.

What is reported

  • Every error your app receives, except those five.
  • The failures the SDK goes on from without telling your app, such as storage that could not be opened, model files the system removed, or a model opened while Quran Lab could not be reached. These show as silent on the Problems tab.

A device that is simply offline is normal, and is not reported.

A report holds where it failed and why, the code your app got, how many times it happened that day, the SDK, app and model versions, and what the device could do: the browser and system, or the device's model code, with its memory and free space in broad steps. It never holds audio, what the model heard, a name, an identifier of the install, the device or the learner, an IP address, a file path or a location.

There is one report per install, day and failure, and no option for them in your app. Reports from a development key are kept apart from production.

The Problems tab

Each app's page under Apps has a Problems tab. Reports of the same failure are one problem. Problems are listed newest first, and each one shows:

  • Where and why. The stage (Settings, Registration, Attestation, Model key, Manifest, Download, Verification, Storage, Engine start, Opening the model, Accelerator, Microphone and audio, Recognition, Sharing, Analytics), the code your app got, the reason and the HTTP status.
  • What happened, and what you can do, in plain words.
  • How much. Installs (approximate), reports, the times it happened, first and last seen, and the last 14 days, one bar a day.
  • Where it happened. Browsers, systems or device models, and SDK, app and model versions. A value seen in fewer than 10 reports is not named, except the SDK and app versions.
  • What stands out. A capability most of the reports share: a page that is not cross-origin isolated, little memory or free storage, a 32 bit process.

Some problems are marked silent: your app was not told, and the SDK went on in a lesser way. For example, a browser that blocks your site's storage downloads the model at every visit. Nothing failed for the learner yet, but a silent problem shows what to fix before it does.

A failure that only your app's learners hit is often something only you can fix: an origin your web key does not list, a Content-Security-Policy that blocks Quran Lab's frame, a release of your app that dropped a permission. When a problem looks like Quran Lab's side, report it, or ask your coding assistant to tell Quran Lab.