-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
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.
7bce631
to
cad04f5
Compare
else -> throw UnrecognizedAction(action) | ||
else -> throw UnrecognizedAction(action) | ||
} | ||
} catch (ex: ActionBeforeSetup) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
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.