Skip to content
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

Handle zip related exceptions #417

Merged
merged 4 commits into from
Jan 15, 2024
Merged

Conversation

anon1892
Copy link
Member

Related to #416, but don't explain it.
This PR just handle a system image as invalid instead of crashing when :

For now, only IMG-e-1.18-t-20231207360613-stable-FP5.zip is known to be in the second case, and it's a very strange installation package, OAI cannot handle that for now (related to #288 ?), so the file is shown as invalid.
Maybe we can explain it with more details to the user?

@tsterbak
Copy link
Member

Nice! I updated the branch to be in sync with the refactoring of the logic of image validation and error messages. Can you have a quick look again, if this is in your sense. Then I merge it :)

@anon1892
Copy link
Member Author

anon1892 commented Jan 14, 2024

Uh, your commit broke it. I will investigate.
PS : I was not aware of this other PR, I like it!

@tsterbak
Copy link
Member

tsterbak commented Jan 14, 2024

Uh, your commit broke it. I will investigate.

Ah sorry for breaking it... I guess I know what went wrong: it should return dict() and not dict. I missed to add this correctly...

@anon1892
Copy link
Member Author

I looked at it. The problem comes from the fact that the first instruction of image_works_with_device() is calling retrieve_image_metadata() : it tries to find metadata, then fails in the case it's not a zip file.
It's written in the logs, but there is no way to send this information to the first called function : then, the showed message is the same as a file without metadata (because the second function only send an empty dictionary)... But it shouldn't.

How do we handle that?

@tsterbak
Copy link
Member

I tried to handle it, now it should work smoothly.

Let me know what you think :)

@anon1892
Copy link
Member Author

Yes, it works, !

@tsterbak tsterbak requested review from tsterbak and removed request for tsterbak January 15, 2024 17:34
@tsterbak tsterbak merged commit 40c9838 into openandroidinstaller-dev:dev Jan 15, 2024
@anon1892 anon1892 deleted the zip branch January 23, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants