-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dotLottie error handling #1969
Add dotLottie error handling #1969
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Great improvements, appreciate it.
@@ -52,7 +52,10 @@ extension FileManager { | |||
// MARK: - DotLottieError | |||
|
|||
public enum DotLottieError: Error { | |||
case invalidFileFormat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is public I think we need to preserve these enum cases, otherwise this would be a breaking change. Could we deprecate the existing cases instead of removing them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha oops accidentally merged the PR after I finished reviewing it. I posted a follow-up PR to add back these three public enum cases: #1970
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, it makes sense to keep them until the next minor/major version is released.
return NSDataAsset(name: assetName, bundle: bundle)?.data | ||
if let asset = NSDataAsset(name: assetName, bundle: bundle) { | ||
self = asset.data | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary? It seems like it may be redundant
return |
Previously discussed in #1957.
LottieLogger
warnings to methods loading from dotLottie.animationUrl
property from DotLottieAnimation.Propagating errors has actually made the error handling shorter and easier to debug.