Error management

This page explains how to manage errors with iink SDK, as well as common pitfalls

Getting error notifications

There are two ways iink SDK may return an error:

  1. Via an exception during the call to an API.

  2. Via IEditorListener.onError() when the error occurs in a background thread.

Exceptions

Possible exceptions for each API call are described in detail in the corresponding API headers.

Editor-level errors

It is highly recommended that you implement IEditorListener::OnError() as part of your integration. This callback provides detailed messages to explain what happened.

The following table lists the main errors and their possible causes:

Error Message Possible cause/solution
Configuration error “error: no such configuration” The configuration file could not be found. Check that the folder containing the *.conf file is referenced by the configuration-manager.search-path key of your engine or editor configuration.
  “error: no such configuration bundle” The configuration bundle could not be found. Check that a bundle with the provided name exists in the *.conf file specified by your engine or editor configuration.
  “error: invalid configuration type”
“error: failed to expand environment variables in placeholders ${}”,
“error: invalid command
There was an error when parsing the *.conf files. Many variants of this message exist, and each of them should be self-explanatory.
Ink cannot be added to a Text Document “ink rejected: stroke is too small (write larger)” The stroke you sent to the part is too small. It may originate from the use of a wrong dpi value to configure the renderer.
  “ink rejected: stroke is too large (write smaller)” The stroke you sent is too large vertically: a Text Document part assumes that ink is written on, and not across, the guides.
  “ink rejected: stroke is above first line” Ink was written within the top margin.
  “ink rejected: cannot write on DIGITAL PUBLISH paragraphs (convert to DIGITAL EDIT)” Text blocks in DIGITAL_PUBLISH conversion state can only receive edit/decoration gestures but no input. You have to convert them to DIGITAL_EDIT to add extra content.
  “ink rejected: stroke is out of document bounds” Ink was written outside of the page boundaries. Note that each time content is added, iink SDK will allocate extra vertical space at the end of the page corresponding to the height of the provided view size.
  “ink rejected: stroke is too long” The length of the stroke (i.e. its number of points) exceeds what the engine can process.
Too many strokes to process “LIMIT_EXCEEDED” You sent more strokes to the recognition engine than what it can concurrently process.
Unexpected error “INVALID_STATE” or “INTERNAL_ERROR” The recognition engine encountered an unexpected error.

Engine-level error

Error Message Possible causes/solutions
Package cannot be opened “error: package is already opened” Before closing a contentPackage, you shall ensure the editor is in idle state, and that no object referencing this contentPackage remains.

Certificate errors

It usually takes the form of an INVALID_CERTIFICATE message printed to the console.

If this occurs, please check:

  1. That the certificate is not time-limited or still valid
  2. If you retrieved the certificate from the Developer Portal, check that it was generated for the bundle ID of your application.

No recognition

If recognition is not working, you may usually get the root cause by looking at errors raised by the editor:

The following causes are the most likely to be involved:

  • The configuration was not found - Ensure that the *.conf file you reference is part of the paths provided to the engine/editor and that the name of the bundle is correct.
  • Recognition assets could not be found - Ensure that the recognition assets are properly deployed alongside your application and properly referenced by the *.conf file.

Recognition quality is poor

Here is a small checklist to consider in this case:

  1. Did you specify the right language? - Check your engine or editor configuration and the corresponding *.conf file and the selected bundle.
  2. If you are recognizing text, are guides enabled? - If they are but you are not relying on them, they may negatively impact the recognition.

  3. Did you call waitForIdle() before attempting to retrieve the results? - Temporary results may not be as relevant as the final one.

  4. Did you provide proper dpi value when instantiating the renderer? - This is fundamental to provide the engine with a sense of “scale”, which may let it for instance differentiate a circle, a letter “o” or a dot, if context is lacking.
  5. Do you send the right content? - If not, you are not likely to get the expected output 😉!

We use cookies to ensure that we give you the best experience on our website Read the privacy policy