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

[APT-10372] Prevent Crashing If Clients Act Too Early #45

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

kabliz
Copy link
Contributor

@kabliz kabliz commented Sep 17, 2024

The ActionBeforeSetup exception is being thrown from an area designed to handle errors, resulting in crashing. We catch these exceptions and update the error state instead.

The `ActionBeforeSetup` exception is being thrown from an area designed to handle errors, resulting in crashing.  We catch these exceptions and update the error state instead.
@kabliz kabliz force-pushed the kabliz/APT-10372-action-before-ready branch from 7bce631 to cad04f5 Compare September 17, 2024 20:33
@kschults kschults self-assigned this Sep 17, 2024
else -> throw UnrecognizedAction(action)
else -> throw UnrecognizedAction(action)
}
} catch (ex: ActionBeforeSetup) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of this, can we handle ActionBeforeSetup in the media session? The whole idea behind this was throwing an error if it was called too soon, so it should be on the client to handle it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Imho moving it to the error field of ArmadilloState is the consistent, intended way errors are to be handled. Clients should be looking into the ArmadilloState for errors, and they shouldn't be expected to look in a 2nd place for them. That's not consistent, and ArmadilloState is a more graceful way to handle these errors without a crash risk.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kabliz LGTM, but wondering why we're not doing this for UnrecognizedAction too

else -> throw UnrecognizedAction(action)
else -> throw UnrecognizedAction(action)
}
} catch (ex: ActionBeforeSetup) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@kabliz LGTM, but wondering why we're not doing this for UnrecognizedAction too

The `ActionBeforeSetup` exception is being thrown from an area designed to handle errors, resulting in crashing.  We catch these exceptions and update the error state instead.
@kabliz kabliz merged commit 5143e83 into main Sep 17, 2024
6 checks passed
@kabliz kabliz deleted the kabliz/APT-10372-action-before-ready branch September 17, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants