-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from rive-app/main
release: 2.1.26
- Loading branch information
Showing
29 changed files
with
656 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.rivereactnative | ||
|
||
import app.rive.runtime.kotlin.core.errors.* | ||
|
||
enum class RNRiveError(private val mValue: String) { | ||
FileNotFound("FileNotFound"), | ||
UnsupportedRuntimeVersion("UnsupportedRuntimeVersion"), | ||
IncorrectRiveFileUrl("IncorrectRiveFileUrl"), | ||
IncorrectAnimationName("IncorrectAnimationName"), | ||
MalformedFile("MalformedFile"), | ||
IncorrectArtboardName("IncorrectArtboardName"), | ||
IncorrectStateMachineName("IncorrectStateMachineName"), | ||
IncorrectStateMachineInput("IncorrectStateMachineInput"); | ||
|
||
var message: String = "Default message" | ||
|
||
override fun toString(): String { | ||
return mValue | ||
} | ||
|
||
companion object { | ||
fun mapToRNRiveError(ex: RiveException): RNRiveError? { | ||
return when (ex) { | ||
is ArtboardException -> { | ||
val err = IncorrectArtboardName | ||
err.message = ex.message!! | ||
return err | ||
} | ||
is UnsupportedRuntimeVersionException -> { | ||
val err = UnsupportedRuntimeVersion | ||
err.message = ex.message!! | ||
return err | ||
} | ||
is MalformedFileException -> { | ||
val err = MalformedFile | ||
err.message = ex.message!! | ||
return err | ||
} | ||
is AnimationException -> { | ||
val err = IncorrectAnimationName | ||
err.message = ex.message!! | ||
return err | ||
} | ||
is StateMachineException -> { | ||
val err = IncorrectStateMachineName | ||
err.message = ex.message!! | ||
return err | ||
} | ||
is StateMachineInputException -> { | ||
val err = IncorrectStateMachineInput | ||
err.message = ex.message!! | ||
return err | ||
} | ||
else -> null | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.