I encountered an error when saving users prior to configuring the plugin:
Install plugin;
Create/save/register a user;
Observe error;
This catches errors thrown by the Stripe API and only queues the sync job when it can be reached.
Additionally, it…
…cleans up the Webhook settings screen messaging, and switches to a UserException so that the error is surfaced when running with devMode off (see “Breaking Changes,” below);
…narrows the scope of CSRF changes in the webhooks controller to preserve them for other CP requests;
…adjusts some Prettier settings so GitHub stops complaining;
Breaking Changes?
I swapped out the yii\base\InvalidConfigException for yii\web\ServerErrorHttpException so that the error message would be surfaced to the user (as a subclass of yii\base\UserException) when devMode is off.
If another extension were to try and catch this somewhere (?), their functionality might break if they weren't using a more relaxed parent class like yii\base\Exception.
I encountered an error when saving users prior to configuring the plugin:
This catches errors thrown by the Stripe API and only queues the sync job when it can be reached.
Additionally, it…
UserException
so that the error is surfaced when running withdevMode
off (see “Breaking Changes,” below);Breaking Changes?
I swapped out the
yii\base\InvalidConfigException
foryii\web\ServerErrorHttpException
so that the error message would be surfaced to the user (as a subclass ofyii\base\UserException
) whendevMode
is off.If another extension were to try and catch this somewhere (?), their functionality might break if they weren't using a more relaxed parent class like
yii\base\Exception
.