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

Increase robustness #7

Open
2 tasks
abraemer opened this issue Oct 9, 2023 · 1 comment
Open
2 tasks

Increase robustness #7

abraemer opened this issue Oct 9, 2023 · 1 comment

Comments

@abraemer
Copy link
Owner

abraemer commented Oct 9, 2023

Right now this package is not very robust: Exceptions during writing a module leaves the startup.jl in a bad state, that does not work correctly and can't be parsed anymore. We should do:

  • Improve parser to handle malformed startup.jl better. At the very least don't just error-out, but give the user a sensible error message.
  • Make a safety copy of startup.jl prior to modification and roll back if errors occured.
@Alseidon
Copy link

Alseidon commented Oct 9, 2023

A problem I found while using the package: add failed to add the code for a package, but still added the first line. So startup.jl now contains the starting line for one module, but nothing else.

This leads to errors by _parse_startup_file : as you do not check whether modules_starts and modules_ends have the same length, atline = module_ends[atmodule]+1 fails (because atmodule has a value of 1 and module_ends is empty.

I realize a fully robust parser would need to do more that check the two above lengths are equal, but this would improve a startup.jl state which the package itself generated.

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

No branches or pull requests

2 participants