Skip to content

"Handling an exception" - "Attention" block #892

@dm-at-ada

Description

@dm-at-ada

The "Attention" block states that exceptions raised in declarative sections "are not caught by the handlers of that block." Based on the descriptions provided and the example code, there is no handler applied to the declarative section, so this makes sense. The handler is applied to a call in the procedure body. Had Dangerous been called in the procedure body, with the handler applied, the exception would have been caught.

Would it be more appropriate to say: exception handlers cannot be applied to anything in the declaration block (and thus, exceptions raised there would not be caught)? It seems like this might be the intent, but that's not what is stated here.

REF: Learn.ada link

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeedbackFeedback from users about their experienceeditorial

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions