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

AddonInfo: const-ified loading and improved errorhandling #5834

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Jan 5, 2024

No description provided.

@firewave
Copy link
Collaborator Author

firewave commented Jan 5, 2024

I tried to simply this by using some helper countless times but I wasn't satisfied with the resulting code (I also had to re-do it completely as I could no longer find any of my stashed previous attempts ...). Maybe something will come to me after I const-ified the other loading code as well.

CC @thingsconnected

lib/addoninfo.cpp Show resolved Hide resolved
lib/addoninfo.cpp Show resolved Hide resolved
@firewave firewave marked this pull request as draft January 5, 2024 12:22
@firewave firewave marked this pull request as ready for review January 5, 2024 12:29
Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.. I clarified the reason I can see for the TODO question.

if (!val.is<std::string>())
return "Loading " + fileName + " failed. 'executable' must be a string.";
addoninfo.executable = getFullPath(val.get<std::string>(), fileName);
return ""; // TODO: why bail out?
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reason: It does not make much sense to configure both "executable" and "script".. If "executable" is provided then current intention is to just ignore the "script" if it's there. We could add a warning/error..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I see - well, no ... I don't. Will take a look later. Will also check if there is proper/actual documentation for the format.

@firewave firewave merged commit 42c3aeb into danmar:main Jan 5, 2024
64 checks passed
@firewave firewave deleted the addon--xx branch January 5, 2024 14:01
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.

3 participants