Link Search Menu Expand Document

Studio Framework for iOS Error Handling

Error Handling

You should wrap your calls into LofeltHaptics in try statements. See: https://docs.swift.org/swift-book/LanguageGuide/ErrorHandling.html

Error Handling Example

do {
    try haptics.load(dataString! as String)
} catch let error as NSError {
    print("Received an error: (error.localizedDescription)")
}

You can also use the try? or try! variations.

Error Types

In the event you encounter an error message while using the Studio framework for iOS, the tips below can help resolve the issue. If the error persists even after trying these remedies, please submit a bug report to Lofelt with the details of the error you receive.

Function Called Error Message Recovery Steps
init (andReturnError) Error initializing core. Report it as a bug.
init (andReturnError) Error initializing Core Haptics engine. Try running your app again. If it fails consistently, it might be a bug.
load Error loading haptic data: Error deserializing. 1. Re-export the haptic clip from Studio.
2. Read the file correctly into a String with UTF-8 encoding.
load Error loading haptic data: Error validating. 1. Re-export the haptic clip from Studio.
2. Read the file correctly into a String with UTF-8 encoding.
load Error loading haptic data: Version unreadable. Download the latest version of the iOS framework and include this in your app.
load Error loading haptic data: An error occurred while starting engine. The iOS framework currently doesn’t restart the CHHapticEngine after sleep. This is coming in a future release.
load Error while extracting data from the input. Read the file correctly into a String with UTF-8 encoding.
play Error playing haptic clip. Call play() only after a haptic clip was loaded without any errors.
stop Error stopping haptic clip. Call stop() only after play().
attachAudioSource Error registering audio source: Interleaved audio is not supported. Only deinterleaved audio is currently supported. Make sure the AVAudioNode you are attaching provides deinterleaved audio. See https://developer.apple.com/documentation/avfoundation/avaudioformat/1389340-isinterleaved

< Prev Next >


Copyright © 2020 Lofelt GmbH. All rights reserved.