Description
RiveViewModel constructors use a lot of force try and force unwrapping. Whenever we accidentally provide a wrong state machine name or smth of that sorts our app crash, while without try! we could gracefully handle this.
Provide a Repro
Just init a RiveViewModel with misspelled state machine and you will get:
Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: RiveRuntime.RiveModel.RiveModelError.invalidStateMachine("State machine named xxx not found")
There are errors being thrown that you don't let us handle.
Source .riv/.rev file
not needed
Expected behavior
init throws an error, which we can then handle
Screenshots
Device & Versions (please complete the following information)
- Device: any
- iOS version any
Additional context
https://github.com/rive-app/rive-ios/blob/63bb20eb0a23be4121bfffea30e0d287677d4ac4/Source/RiveViewModel.swift