moko-permissions icon indicating copy to clipboard operation
moko-permissions copied to clipboard

DeniedAlwaysException should not extend DeniedException

Open bpappin opened this issue 10 months ago • 2 comments

When DeniedAlwaysException extends DeniedException, the exceptions must be caught in the correct order, with DeniedAlwaysException always first, because DeniedAlwaysException is also a DeniedException and if it's first in the catch stack, the DeniedAlwaysException block will never be called.

The solution is to have them each extend Exception instead.

bpappin avatar Feb 15 '25 14:02 bpappin