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

Throw exception for unregistered profile #69

Open
wants to merge 1 commit into
base: 2.1.x
Choose a base branch
from

Conversation

jensschuppe
Copy link
Collaborator

Fixes #68.

When a CiviMRF profile does not exist but is selected within a CiviMRF connector, there will be PHP warnings (Warning: Undefined array key "produktivumgebung" in Drupal\cmrf_core\Core->getConnectionProfile() (line 32 of modules/contrib/cmrf_core/src/Core.php).). This throws an exception instead.

Copy link
Collaborator

@dontub dontub left a comment

Choose a reason for hiding this comment

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

RuntimeException might be a more appropriate exception (apart from a custom one).

Would it make sense to throw an exception already in CMRFConnector::load()?

Does the error code have any meaning? If yes, I'd suggest to define it as a constant in some error code class that makes its meaning clear, otherwise I'd drop it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants