Skip to content

Bug box in case of Program_Error and related tweaks#1595

Merged
mosteo merged 4 commits into
alire-project:masterfrom
mosteo:feat/bug-box
Feb 28, 2024
Merged

Bug box in case of Program_Error and related tweaks#1595
mosteo merged 4 commits into
alire-project:masterfrom
mosteo:feat/bug-box

Conversation

@mosteo

@mosteo mosteo commented Feb 27, 2024

Copy link
Copy Markdown
Member

Instead of the terse please re-run..., say something more informative and conducive to a report, but only for true Program_Error exceptions:

$ alr dev --raise
error: ******************* BEGIN Alire bug detected *******************
error: Location  : Alr.Commands.Dev.Execute at alr-commands-dev.adb:77
error: Extra info: Raising forcibly
error: Report at : https://github.com/alire-project/alire/issues/new?title=[Bug%20box]
error: Re-run with `-vv -d` for a full stack trace.
error: ******************** END Alire bug detected ********************

In very limited situations where we can continue, report instead a recoverable error:

$ alr dev --error
warn: ******************* BEGIN Alire bug detected *******************
warn: Location  : Alr.Commands.Dev.Execute at alr-commands-dev.adb:73
warn: Extra info: Forced error
warn: Report at : https://github.com/alire-project/alire/issues/new?title=[Bug%20box]
warn: Re-run with `-vv -d` for a full stack trace.
warn: Alire will now continue as the error might be recoverable.
warn: ******************** END Alire bug detected ********************

And finally clarify internally the difference with a Recoverable_User_Error.

@mosteo mosteo force-pushed the feat/bug-box branch 2 times, most recently from 4853532 to 546577f Compare February 27, 2024 15:26
@mosteo mosteo marked this pull request as ready for review February 27, 2024 16:12
Comment thread src/alire/alire-errors.ads Outdated
Stack_Trace : String := "";
Stack_Offset : Natural := 0);
-- For unexpected situations where normally a Program_Error would be
-- adecuate, but we do not want to bomb on the user because continuing is

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

adequate?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My Spanglish seeping through

@mosteo mosteo merged commit 7d67c4b into alire-project:master Feb 28, 2024
@mosteo mosteo deleted the feat/bug-box branch February 28, 2024 18:54
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.

2 participants